Vertical vs Horizontal Scaling
System Design: lesson 2 of 15
Buy a bigger machine, or buy more of them.
Lesson 2 of 15 · 5 min
Vertical vs Horizontal Scaling
Step 1 of 10
One machine answers everything. It is full at about 800 requests a second.
The Idea
Vertical scaling gives one machine more CPU, memory or disk. Horizontal scaling adds machines and spreads the work across them. Scaling up needs no code changes; scaling out has no ceiling, but only works when a request can land on any machine and still be answered correctly.
Real-World Example
A newspaper with one printing press can buy a faster press or a second press. The faster one still stops the whole edition when a roller jams. Two presses keep half the run moving — but now somebody has to split the job and collate the output afterwards.
The Tradeoff
Scaling up is bounded by the largest box on the market, usually costs downtime to resize, and leaves one failure that takes everything with it. Scaling out demands stateless servers and request routing, which is real complexity. Buy it once the single machine is actually full, not before.
Your turn
Put the steps in the right order.
- Move session state out of the server so any machine can answer
- Give the single server more memory and CPU while that is still cheap
- Put a load balancer in front and add a second identical server
- Measure what is actually saturated: CPU, memory, disk or network
Mini quiz
1 / 3