System Design Foundation

Vertical vs Horizontal Scaling

By Ayush Arora2 min read

Vertical scaling vs horizontal scaling

When a system needs to handle more load, there are two directions you can go.

When scaling up is fine

If traffic is low, vertical scaling is a great first move. Its main advantage is simplicity: there is no new architecture to build, no code to change, no traffic to distribute. You resize the box and carry on.

But it has two serious limits.

Why large systems scale out

Because of those limits, horizontal scaling is the better fit for large scale applications. More servers means you can keep growing past what any single machine can do, and if one server fails, the others keep serving traffic.

The tradeoff is complexity. Once there is more than one server, something has to decide which server each incoming request goes to.

This is where a load balancer comes in

In the design so far, users talk to the web server directly. That creates two problems:

A load balancer solves both. It sits in front of the web servers, and clients connect to it instead of to any server directly. It then spreads incoming requests across the pool of servers so no single one is overwhelmed, and it stops sending traffic to a server that has failed. That is the topic of the next post.