Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Vertical Scaling
HLD

Vertical Scaling

Bigger machines — the simplest scaling lever, its hard ceiling, and when it's still the right first move.

The Definition

 VERTICAL scaling (scale UP): more resources in ONE node
   4 vCPU → 16 vCPU → 64 vCPU
   16GB → 128GB → 2TB RAM
   HDD → NVMe → RAM-backed storage
 
 code unchanged. deployment unchanged. just... bigger.

Why It’s the First Lever

 zero architectural change:
 - no sharding logic, no distributed transactions, no rebalancing
 - single point of administration, simple backups, simple debugging
 - every framework and database loves one big machine
 
 cost curve favors it too — up to a point:
   one 32-core box often cheaper + faster than four 8-core boxes
   coordinating four nodes costs latency and complexity

The Hard Limits

 physical ceiling:    largest instance a cloud sells (~hundreds of vCPU)
 economic ceiling:    price per core RISES with instance size
                      top-tier instances cost multiples per-unit-work
 failure ceiling:     one node = one blast radius; VM host failure
                      takes EVERYTHING down; recovery = full restart
 maintenance ceiling: OS patches need restarts; "scale up" offers
                      no rolling-upgrade story for a singleton

The economic curve is the sneaky one: doubling cores at the top of the line can triple cost, while horizontal nodes add linearly.

Where Vertical Remains Correct

WorkloadWhy vertical fits
Relational primary DBSharding SQL is painful; big boxes postpone it years
Cache nodesRedis single-threaded-ish; one huge node beats clusters
Batch computeWhole-dataset-in-RAM beats distribution overhead
Early-stage productsComplexity budget better spent on product

Databases are the canonical case: scale up as long as possible, because distributing transactional state is the most expensive complexity in systems design.

The Operational Pattern

 vertical scaling WITH availability:
   primary (big) ──replication──► standby (same size)
   failover on primary death; planned upgrades = switchover

 this hybrid keeps operational simplicity while fixing
 the singleton-failure problem — standard DB topology

Diminishing Returns in Practice

 watch for these signals that vertical is ending:
 - next instance tier doubles cost, not capacity headroom
 - single-node IOPS/network caps become the bottleneck,
   not CPU/RAM
 - restart windows hurt even with a standby (cache loss)
 
 then: read replicas (offload reads) before sharding (split data).
 vertical → replicas → partitioning is the classic ladder

Interview Framing

“Database is at 80% CPU — what do you do?” opens with vertical: cheapest move, no architecture change, quantify it (“next tier 4x”). Then immediately ladder onward: replicas for read load, caching to cut load entirely, sharding only when writes force it. Candidates who jump straight to sharding skip three cheaper rungs.

My Private Notes

Notes are auto-saved locally to this device.