Chapter 9: Vertical vs Horizontal Scaling

Vertical Scaling (Scale Up)

Add more power to existing machine: more CPU, RAM, faster disk.

Horizontal Scaling (Scale Out)

Add more machines. Distribute load across them.

When to Use Each

ScenarioApproachWhy
Database (early stage)VerticalSimpler than sharding, buys time
App serversHorizontalStateless = easy to replicate
Cache (Redis)Horizontal (cluster)Distribute keys across nodes
Database (at scale)Horizontal (sharding)Single node can't hold all data
💡 Practical Strategy

Scale vertically first (it's simpler). When you hit hardware limits or need redundancy, scale horizontally. Most companies never need more than a few servers — don't over-engineer.

Key Takeaways