6. Vertical vs Horizontal Scaling
1
The picture to keep in your head2
6.1 What does "scaling" actually mean?3
6.2 What is vertical scaling?4
6.3 What is horizontal scaling?5
6.4 Why does scaling out need stateless servers?6
6.5 If servers are stateless, where does the state go?7
6.6 What is autoscaling, and how do you get it right?8
6.7 What about the database? Why is it the hardest part to scale?9
6.8 What does each kind of scaling really cost?10
6.9 So when do you choose which?11
Memory card and where the analogy breaks12
Practice: five levels13
Interview questions14
Solutions15
Sources16
Code lab6. Vertical vs Horizontal Scaling
Sources
3 min read+10 XP
Source notes
- Amdahl's law: Gene Amdahl, "Validity of the single processor approach to achieving large scale computing capabilities", AFIPS Conference Proceedings, 1967. Speed-up figures computed 2026-10-08.
- Autoscaling concepts (target tracking, scheduled and predictive scaling, cooldowns, warm-up) are described in the major cloud providers' autoscaling documentation (for example, AWS EC2 Auto Scaling and Google Cloud managed instance groups). Behaviour details vary by provider.
- Spot or preemptible instances can be reclaimed by the provider at short notice: provider documentation (AWS Spot Instances, Google Cloud Spot VMs).
- All Book Fest numbers (traffic, per-server capacity, warm-up time, hours) are illustrative assumptions. Arithmetic computed 2026-10-08.
- Level 3 and Level 4 code: tested 2026-10-08 (
code/ch06_scaling.py, all checks pass).