Horizontal Vs Vertical
Compare scale-up and scale-out strategies through practical trade-offs.
Curriculum
System Design Foundations
Scalability Basics
Database Design
Horizontal Vs Vertical Scaling — Beginner Friendly System Design Guide
Why Scaling Matters
Every application starts small.
Initially:
- few users
- low traffic
- simple infrastructure
One server is usually enough.
But as product grows:
- traffic increases
- APIs slow down
- servers overload
- databases struggle
system must scale.
There are two major ways to scale systems:
1. Vertical Scaling (Scale Up)
2. Horizontal Scaling (Scale Out)
Understanding both is one of the most important topics in system design.
Real Example — Swiggy During Dinner Time
At:
- 3 AM → low traffic
- 8 PM → huge traffic spike
Suddenly:
- lakhs of users open app
- place orders
- refresh restaurants
Now Swiggy infrastructure must handle:
- more API requests
- more database queries
- more payments
This is where scaling becomes necessary.
What Is Vertical Scaling?
Vertical scaling means:
Increasing power of existing machine.
Also called:
Scale Up
Example
Upgrade server from:
8 GB RAM → 64 GB RAM
4 CPU → 32 CPU
Real-Life Analogy
Imagine delivery business.
Instead of:
- buying more bikes
you buy:
- one giant truck
Vertical Scaling Flow
Small Server
│
Upgrade CPU / RAM / SSD
▼
Powerful Bigger Server
Real Startup Example
Suppose your ecommerce startup initially has:
500 users/day
One server works perfectly.
Later after influencer marketing:
- traffic becomes massive
Instead of redesigning architecture:
- company upgrades hardware
This is vertical scaling.
Advantages Of Vertical Scaling
| Benefit | Why Useful |
|---|---|
| Easy setup | Minimal architecture changes |
| Simpler management | One machine easier to maintain |
| Faster implementation | Upgrade quickly |
| Lower operational complexity | No distributed system coordination |
Problems With Vertical Scaling
| Problem | Why Bad |
|---|---|
| Hardware limit | Cannot scale infinitely |
| Expensive | High-end servers cost a lot |
| Single point of failure | One crash affects everything |
| Downtime risk | Hardware upgrades may require restart |
Example Problem
Suppose entire platform runs on:
One giant server
If that server crashes:
Users
│
▼
Single Server ❌
Entire application goes down.
What Is Horizontal Scaling?
Horizontal scaling means:
Adding more servers instead of increasing one server's power.
Also called:
Scale Out
Example
Instead of:
1 huge server
use:
10 medium servers
Real-Life Analogy
Instead of:
- one giant truck
use:
- many delivery bikes
This improves:
- scalability
- flexibility
- fault tolerance
Horizontal Scaling Architecture
Load Balancer
│
┌──────────────┼──────────────┐
▼ ▼ ▼
Server1 Server2 Server3
Why Horizontal Scaling Is Powerful
If traffic grows:
- add more servers
Simple idea.
Example — Hotstar IPL Streaming
During IPL:
- crores of concurrent users join
One server cannot handle:
- video streaming
- authentication
- recommendations
- live scoring
Hotstar uses:
- distributed infrastructure
- thousands of servers
- CDNs
- load balancers
This is horizontal scaling.
Why Load Balancer Is Needed
When multiple servers exist:
- traffic must be distributed evenly
using:
Load Balancer
Load Balancer Flow
Users
│
▼
Load Balancer
├── App Server 1
├── App Server 2
└── App Server 3
What Happens Without Load Balancer?
Users
│
▼
One Server
│
▼
Server Overloaded ❌
With Horizontal Scaling
Users
│
▼
Load Balancer
│
┌─┼──────────┐
▼ ▼ ▼
S1 S2 S3
Traffic distributes safely.
Advantages Of Horizontal Scaling
| Benefit | Why Important |
|---|---|
| Near unlimited scalability | Add servers gradually |
| Better fault tolerance | One server can fail |
| High availability | System remains online |
| Flexible scaling | Scale during traffic spikes |
| Better reliability | Distributed infrastructure |
Problems With Horizontal Scaling
| Challenge | Why Difficult |
|---|---|
| Complex architecture | Multiple machines coordination |
| Distributed systems issues | Synchronization problems |
| Data consistency harder | Shared state becomes difficult |
| Load balancing required | Traffic routing needed |
| Debugging complexity | More moving parts |
Real Example — WhatsApp
WhatsApp cannot run on:
- one machine
Millions of users:
- send messages
- upload media
- make calls
simultaneously.
WhatsApp uses:
- distributed systems
- horizontal scaling
- globally distributed infrastructure
WhatsApp Global Architecture
Users Worldwide
│
▼
Global Load Balancers
│
┌──────┼────────┐
▼ ▼
India Servers US Servers
│
▼
Distributed Databases
Comparing Vertical vs Horizontal Scaling
| Vertical Scaling | Horizontal Scaling |
|---|---|
| Scale up | Scale out |
| Bigger machine | More machines |
| Easier initially | More scalable |
| Hardware limits | Near unlimited scaling |
| Single point of failure | Better fault tolerance |
| Simpler architecture | Distributed complexity |
| Expensive large servers | Commodity servers possible |
Real Example — Zerodha
Stock trading systems require:
- low latency
- strong consistency
Sometimes critical systems prefer:
- strong vertical scaling
because:
- distributed coordination adds latency
Real Example — Netflix
Netflix serves:
- millions globally
Netflix heavily uses:
- horizontal scaling
- distributed microservices
- CDNs
because:
- scale is enormous
Database Scaling
Applications are not only bottlenecks.
Databases also need scaling.
Vertical Database Scaling
Small Database Server
│
Upgrade Hardware
▼
Larger Database Server
Horizontal Database Scaling
Application
│
▼
Shard Router
┌────┼────┐
▼ ▼ ▼
DB1 DB2 DB3
This is called:
Database Sharding
When Vertical Scaling Makes Sense
Useful for:
- MVPs
- startups
- low traffic apps
- early development
Example
Early SaaS startup:
1 server
1 database
is usually enough.
When Horizontal Scaling Becomes Necessary
Needed when:
- millions of users exist
- traffic spikes happen
- global scale needed
- high availability required
Example Companies Using Massive Horizontal Scaling
| Company | Reason |
|---|---|
| Billions of searches | |
| YouTube | Massive video streaming |
| Swiggy | Traffic spikes |
| Amazon | Global ecommerce |
| Huge social traffic |
Trade-Off Thinking In System Design
There is NO perfect scaling solution.
Every decision involves trade-offs.
Vertical Scaling Trade-Off
Simple but limited
Horizontal Scaling Trade-Off
Scalable but complex
Common Beginner Misconceptions
"Just Buy Bigger Server"
Not sustainable forever.
Eventually:
- hardware limits appear
- costs explode
"Horizontal Scaling Is Always Better"
No.
It introduces:
- distributed system complexity
- synchronization problems
- debugging challenges
"Scaling Means Only Adding Servers"
No.
Real scalability also involves:
- caching
- queues
- CDN
- replication
- database optimization
Final Mental Model
Vertical Scaling =
Increase server power
Horizontal Scaling =
Increase number of servers
Complete Scalable Architecture
Users
│
▼
CDN
│
▼
Load Balancer
│
┌─┼────────────┐
▼ ▼ ▼
App1 App2 App3
│
▼
Redis Cache
│
▼
Database Cluster
One-Line Interview Definition
Vertical scaling increases the power of a single machine, while horizontal scaling increases the number of machines to distribute traffic and workload more efficiently.
Module context
Scaling from 100 to 10 crore users. Vertical vs horizontal scaling, load balancers, and the trade-offs behind every scaling decision.