System Design Playbook
01 · Fundamentals6 min read

Horizontal vs vertical scaling

Two ways to handle more traffic: make the machine bigger, or add more machines. What each one costs, where each one breaks, and why real systems end up using both.

In one sentence

Vertical scaling means a bigger server; horizontal scaling means more servers sharing the work. Vertical is simpler, horizontal goes further.

Two ways to grow

Your app is getting more traffic and the server is at 90% CPU. You can scale up (vertical: more CPU, RAM, faster disk on the same machine) or scale out (horizontal: more machines behind a load balancer).

Move the traffic slider, switch strategies, and kill a server to see what happens to capacity, cost and availability.

Vertical vs horizontal scaling
Scaling
Users900 rpsServer4 vCPU · 16 GB
Capacity
1,200 rps
Utilization
75%
Relative cost
×2.4
If one server dies
service down
Vertical scaling buys a bigger machine. Simple, no code changes, but there is a ceiling, price grows faster than capacity and it's still one machine.
Costs are relative and illustrative: bigger cloud instances tend to cost more per unit of capacity at the top end.

Vertical scaling (scale up)

Why it's great

  • No code changes: same app, bigger box
  • No distributed-system problems: one memory, one disk
  • Perfect for databases, which are hard to split

Where it breaks

  • There is a biggest machine, and you'll eventually hit it
  • Top-end hardware costs more per unit of capacity
  • Resizing usually means a restart
  • Still a single point of failure

Horizontal scaling (scale out)

Why it's great

  • Practically no ceiling: keep adding machines
  • Failures only remove a slice of capacity
  • Autoscaling: add servers at peak, remove them at night
  • Many small machines are cheap

What it requires

  • A load balancer in front
  • Stateless servers: sessions and files live in Redis, a database or object storage, not in the server's memory or disk
  • Dealing with distributed problems: consistency, network failures, deploys across many machines

What real systems do

LayerUsual approach
Web / API serversHorizontal: stateless containers behind a load balancer, with autoscaling
Cache (Redis)Vertical first, then a cluster split by key
Relational databaseVertical as far as it goes, then read replicas, then sharding
Static files and videoObject storage + CDN, which scale horizontally for you

Netflix runs thousands of stateless service instances that scale out with demand, while each database tier is scaled with its own mix of bigger machines, replicas and partitioning.

Key takeaways

  • 01Vertical = bigger machine: simple, limited, single point of failure.
  • 02Horizontal = more machines: near-unlimited and resilient, but needs stateless services and a load balancer.
  • 03Stateless app servers scale out easily; databases are usually scaled up first.
  • 04Most systems combine both, layer by layer.

Check your understanding

1 of 3

What is vertical scaling?

Related concepts