Serksa
All Concepts
Performance & Scaling

Horizontal vs Vertical Scaling

1

What is it?

<strong>Horizontal scaling</strong> means adding more servers to handle traffic, while <strong>vertical scaling</strong> means making your existing server more powerful. Horizontal scales out (more machines), vertical scales up (bigger machine).

2

Think of it like...

The Restaurant Analogy

Vertical scaling is like upgrading to a bigger kitchen with more equipment. Horizontal scaling is like opening multiple restaurant locations. Horizontal is usually better for web apps.

🍽️

One Big Kitchen (Vertical)

Bigger stove, more chefs

🏪

Multiple Locations (Horizontal)

More restaurants

👥

Customers (Traffic)

Need to be served

3

Visual Flow

📈Traffic Increases

More Users

⚖️Choose Strategy

Horizontal or Vertical

🚀Scale

Handle Load

4

Where you see it

1

Vertical: Upgrade hardware

Add more RAM, CPU, storage to one server

2

Horizontal: Add servers

Deploy identical copies of your app

3

Vertical: Limited by hardware

Eventually hit physical limits

4

Horizontal: Infinite scaling

Keep adding servers as needed

5

Horizontal needs load balancer

Distribute traffic across servers

5

Common Mistake

Wrong

"Vertical scaling is always cheaper"

Correct

<strong>Horizontal scaling is often cheaper long-term</strong>. Vertical has limits and expensive hardware. Horizontal uses commodity servers and scales infinitely.

💡 Real-World Example

Netflix scaling:

1

Started with vertical scaling (bigger servers)

2

Hit limits during peak hours

3

Switched to horizontal scaling (thousands of servers)

4

Can now handle 200M+ users simultaneously