AI Hints
Home›System Design Tutorial›Up, Big and Clear
System Design · Lesson 8 of 120

Vertical vs Horizontal Scaling

Bigger or more.

⏱ 2 min read▶ Video at 8:11🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

Your app is getting slow because more people use it. You have two choices. Buy a bigger machine, or add more machines. These are called vertical and horizontal scaling.

Vertical vs Horizontal Scaling
From the video: Vertical vs Horizontal Scaling
  • More users, slower app
  • A bigger machine
  • Or more machines

Two ways to grow

Vertical scaling means a bigger server, with more CPU and memory. It's simple, because nothing in your code changes. But there's a ceiling, and one machine is still a single point of failure. Horizontal scaling means more servers working together. There's almost no ceiling, and one can fail safely. But it's more complex.

Vertical: bigger

  • Simple, no code changesHas a ceilingOne machine can fail

Horizontal: more

  • Almost no ceilingSurvives a failureMore complex

What usually happens

In practice, most companies do both. They start with one decent machine, and scale vertically while it's cheap. When they hit limits, they scale out, adding servers behind a load balancer. Most of this course is about making horizontal scaling work.

keyvalue
Day oneone server
Growinga bigger server
Bigmany servers
This coursemaking 'many' work

Summary

Vertical scaling buys a bigger machine, horizontal scaling adds more machines. Big systems scale horizontally. Next, the first step of every design. Requirements.

Key takeaways
  • Vertical: simple, limited
  • Horizontal: unlimited, complex
  • Most do both
Next up: Requirements First — functional and non-functional