SystemDesign.io
Track 1: foundationsID: vertical-vs-horizontal-scaling
Mode: structuredDifficulty: beginner-intermediate⏱️ 15 mins
Module · High-Level Design · 15 min

Bigger Machine vs More Machines

When traffic grows, you can buy a monster server (Scale Up) or add a fleet of commodity servers (Scale Out). Let's master the core scaling trade-offs.

01 / Concept Cards (Theory)

Scale Up vs Scale Out

Understand vertical vs horizontal scaling, stateless architectures, and server crash resilience.

1. The Core Philosophy: Vertical vs Horizontal

Vertical Scaling (Scale Up) means upgrading your single server's hardware — adding more RAM, more CPU cores, or faster SSDs.
Horizontal Scaling (Scale Out) means adding more servers to your pool and spreading traffic across them using a Load Balancer.

Vertical Scaling (Scale Up)Buy a 128-core Monster ServerPros: Simple. No architecture or code changes needed.
Cons: Hard hardware ceiling (you can't buy an infinite CPU), exponential cost curve, single point of failure (SPOF).
Horizontal Scaling (Scale Out)Add 8x Commodity App ServersPros: Infinite scaling potential, fault tolerance, no single point of failure.
Cons: Requires stateless app servers, Load Balancers, and externalized session storage.

2. Visualizing the Architecture

Compare the two setups below. Watch how horizontal scaling uses a Load Balancer to distribute requests across disposable app servers.

🖥️ Vertical Scaling (Single Monster Server)
👥 100K UsersHeavy Traffic🖥️ Monster Server128 CPU Cores | 512GB RAMApp Code + Sessions + Database⚠️ If this server dies = 100% Outage
🌐 Horizontal Scaling (Stateless Cluster + LB + Redis)
👥 Users⚖️ LBStateless LB🖥️ Server A🖥️ Server B🖥️ Server C⚡ RedisShared Sessions

3. The Secret to Scaling Out: Stateless Architecture

Why can't you just add more servers to a legacy monolith? Because of Session State.

❌ Stateful Server Problem

Server 1 stores the user's login session in its local RAM memory. If the Load Balancer sends the next request to Server 2, Server 2 doesn't have the session — logging the user out instantly!

Workaround: "Sticky Sessions" (pins user to 1 server), but breaks load distribution if 1 server gets heavy traffic.
✅ Stateless Architecture Solution

Move session state OUT of the app servers into an Externalized Cache (Redis / Memcached). Now, ANY app server can handle ANY request because all servers read sessions from Redis!

App servers become 100% disposable & auto-scalable. Add/remove instances anytime!

4. Interactive Scaling Scenario Quiz

Test your system design intuition! Choose whether Vertical (Scale Up) or Horizontal (Scale Out) is the right architecture move.

🚀 You are launching a new startup MVP with 100 daily users. You want minimum operational complexity and zero devops overhead.
✅ Vertical Scaling is correct! Don't over-engineer early! For an MVP with light traffic, a single $10/mo cloud instance is simpler, cheaper, and requires 0 DevOps maintenance.
🛍️ An e-commerce site experiences a Black Friday traffic surge of 500,000 requests/sec. A single server maxes out its CPU.
✅ Horizontal Scaling is correct! No single physical machine can handle 500K req/sec. You need a Load Balancer auto-scaling an elastic cluster of 50+ stateless app instances.
🏛️ A 20-year-old legacy enterprise app stores user session state in global server RAM variables. Rewriting the code would take 2 years. Traffic doubled today.
✅ Vertical Scaling is correct! Because the app is stateful and cannot easily share sessions, adding more servers breaks sessions. Upgrading the server's RAM/CPU (Scale Up) is the only short-term fix while refactoring.
🏥 A healthcare provider requires 99.999% uptime (Five Nines). If a server hardware component fails, the system must not go offline.
✅ Horizontal Scaling is correct! A single monster server (Vertical) is a Single Point of Failure (SPOF). If its motherboard fails, you go offline. Horizontal clusters provide fault tolerance: if Server A dies, the Load Balancer routes traffic to Servers B and C.

5. System Design Interview Comparison Matrix

Quick reference table for system design interviews:

CriteriaVertical Scaling (Scale Up)Horizontal Scaling (Scale Out)
Scaling LimitHard hardware ceiling (Max CPU/RAM)Virtually infinite (Add 1,000+ servers)
Cost CurveExponential (High-end hardware is very expensive)Linear (Commodity cloud VMs)
Fault Tolerance❌ Single Point of Failure (SPOF)✅ High Availability (Failover across nodes)
App RequirementsWorks with stateful or legacy monolithsRequires stateless app servers & external cache
Operation ComplexityVery Low (Single server to manage)Higher (Load balancers, service discovery, K8s)
02 / Practice Exercise

Build Your Architecture

Convert a single-server monolith into a horizontally scaled, stateless architecture.

Interactive CanvasMode: Freeform Drag & Connect

Task: Horizontal Scaling & Stateless Architecture

🎯
Scenario Prompt: You have an app experiencing high traffic. Design a horizontally scalable system: place a Load Balancer, 2 Stateless App Servers, an externalized Redis Session Cache, and a Database.
Available Components (Click to place on canvas):
🖱️Canvas is emptyClick components above to place them onto the canvas.
Drag components to arrange them freely, and click two nodes to connect them.
💡 Drag to move • Click Node A ➔ Node B to connect • Click ✕ to delete

Evaluation Checklist

1. User ➔ Load Balancer.
2. Load Balancer ➔ App Server A & App Server B.
3. Both App Servers ➔ Redis Session Cache (Stateless architecture).
4. Both App Servers ➔ Database.