6. Vertical vs Horizontal Scaling
6.8 What does each kind of scaling really cost?
In the kitchen: One superstar chef can cost more than three good chefs together. Extra chefs for the rush only cost money during the rush. But more chefs also means more managing, more uniforms and more chance of mix-ups.
In the system:
| Scale up | Scale out | |
|---|---|---|
| Machine cost | Rises steeply for the largest sizes | Many ordinary, cheaper machines |
| Paying for peaks | You pay for the big machine all day | Autoscaling pays only for the rush |
| Engineering cost | Low: nothing changes | Higher: stateless design, load balancer, monitoring many machines |
| Failure cost | One failure stops everything | One failure is absorbed |
The autoscaling saving, worked out (assumed numbers): Book Fest needs 68 servers for 2 hours a day and 8 the other 22 hours.
- Always running 68: 68 × 24 = 1,632 server-hours a day.
- Autoscaled: 68 × 2 + 8 × 22 = 312 server-hours a day, about 81% less.
Cloud pricing options also matter: on-demand (pay by the hour, most flexible), reserved or committed (cheaper for a steady baseline you'll always need) and spot or preemptible machines (much cheaper, but the provider can take them back at short notice, so only for stateless or batch work that can be interrupted).
And don't forget people cost: a design that saves 20% on servers but needs a team to babysit it may not be cheaper.
Memory code: "Pay for the rush only during the rush." Baseline reserved, peaks on demand, interruptible work on spot.