Scaling Web Applications: Vertical vs Horizontal Scaling

MEDIUM8 min readby AdminJune 19, 2026History
5.0|1 ratingLog in to rate

Understand the fundamental scaling strategies for web applications, including vertical vs horizontal scaling and the role of load balancers.

#system-design#scaling#load-balancing#architecture

What is Scalability?

Scalability is the ability of an application or infrastructure to handle an increasing workload without degrading performance. As user volume grows, the system must adapt by utilizing resources efficiently.

Vertical vs Horizontal Scaling

  1. Vertical Scaling (Scale Up): Adding more horsepower (CPU, RAM, SSDs) to a single server instance.

    • Pros: Simple configuration, low latency, no network communication overhead.
    • Cons: Hard hardware limits, single point of failure (SPOF), and high cost scaling curve.
  2. Horizontal Scaling (Scale Out): Adding more servers/machines to the system resource pool.

    • Pros: High availability, infinite scaling limits, and cost efficiency using commodity hardware.
    • Cons: High architectural complexity, requires load balancing, and introduces data consistency challenges.

Horizontal scaling partition tradeoffs are explained in detail in the CAP Theorem guide.

Nginx Load Balancer Configuration

nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
http {
  upstream myapp {
    server srv1.example.com;
    server srv2.example.com;
    server srv3.example.com;
  }

  server {
    listen 80;
    location / {
      proxy_pass http://myapp;
    }
  }
}

Real-world Scaling Case Study

Example

A startup begins with a single AWS EC2 instance running both the web server and PostgreSQL (Vertical Scaling). When concurrent traffic passes 10,000 users, they split the database onto RDS, place the web servers in an Autoscaling Group behind an Application Load Balancer (ALB), and introduce caching layers (Horizontal Scaling).

Discussion

Join the discussion! Sign in to leave comments and ask questions.

Loading discussion...