Lesson 11 of 16
6. Vertical vs Horizontal Scaling

Memory card and where the analogy breaks

3 min read+10 XP

The memory card (tear this page out)

#QuestionMemory code
6.1What is scaling?Scaling is staying fast when the crowd grows
6.2Vertical scaling?Bigger chef, same kitchen, same ceiling
6.3Horizontal scaling?More chefs, but only if the work can be split
6.4Why stateless?Any chef can cook any order
6.5Where does state go?Nothing important lives in a chef's head
6.6Autoscaling?Scale out fast, scale in slow, and schedule what you know
6.7The database?Fix, cache, grow, copy, split
6.8Cost?Pay for the rush only during the rush
6.9Which to choose?Scale up to start, scale out to grow, and always keep two

The whole chapter in one line: Keep the chefs forgetful, hire before the rush, and climb the pantry ladder one step at a time.

Where the analogy breaks

  • New chefs walk in ready to cook. New servers need minutes to start and often start with cold caches, so they're slower at first.
  • Chefs can shout to each other across the kitchen. Servers talk over a network, which is slower and can fail, so splitting work across machines adds delays the kitchen never has.
  • A pantry runs out of rice in an obvious way. A database slowly gets slower as load grows, until it suddenly falls off a cliff (Chapter 5, section 5.8).

Quick check

Five questions on this chapter. Pick an answer, then check it.

quiz