Back to course
    article~25 min readScalability Basics

    Horizontal Vs Vertical

    Compare scale-up and scale-out strategies through practical trade-offs.

    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

    BenefitWhy Useful
    Easy setupMinimal architecture changes
    Simpler managementOne machine easier to maintain
    Faster implementationUpgrade quickly
    Lower operational complexityNo distributed system coordination

    Problems With Vertical Scaling

    ProblemWhy Bad
    Hardware limitCannot scale infinitely
    ExpensiveHigh-end servers cost a lot
    Single point of failureOne crash affects everything
    Downtime riskHardware 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

    BenefitWhy Important
    Near unlimited scalabilityAdd servers gradually
    Better fault toleranceOne server can fail
    High availabilitySystem remains online
    Flexible scalingScale during traffic spikes
    Better reliabilityDistributed infrastructure

    Problems With Horizontal Scaling

    ChallengeWhy Difficult
    Complex architectureMultiple machines coordination
    Distributed systems issuesSynchronization problems
    Data consistency harderShared state becomes difficult
    Load balancing requiredTraffic routing needed
    Debugging complexityMore 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 ScalingHorizontal Scaling
    Scale upScale out
    Bigger machineMore machines
    Easier initiallyMore scalable
    Hardware limitsNear unlimited scaling
    Single point of failureBetter fault tolerance
    Simpler architectureDistributed complexity
    Expensive large serversCommodity 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

    CompanyReason
    GoogleBillions of searches
    YouTubeMassive video streaming
    SwiggyTraffic spikes
    AmazonGlobal ecommerce
    InstagramHuge 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.

    Mark this lesson complete when you finish reviewing it.