Skip to main content
PreparationZone Logo
PrepZone

Vertical vs Horizontal Scaling

Scale up, scale out, and know when each approach stops working.

Pass checkpoint below

Vertical scaling (scale up)

Vertical scaling increases CPU, RAM, or disk on a single instance. It is simple: no code changes, no distributed-systems complexity.

Vertical scaling pros and cons

  • Pros — zero architecture change, no network partition issues, easy ops.
  • Cons — hard ceiling (largest instance size), single point of failure, expensive at the top end.
  • Best for — early StreamHub MVP, managed databases before sharding, stateful workloads that resist distribution.
Java
# StreamHub phase 1 — vertical growth
instance: t3.medium → t3.xlarge → r6g.2xlarge
database: db.t3.medium → db.r6g.4xlarge
# Worked until ~20K concurrent users

Horizontal scaling (scale out)

Horizontal scaling adds identical nodes behind a load balancer. Stateless app servers are the classic example.

AWS ALB → EKS traffic path

TLSCLIENT
UsersHTTPS requests
NETWORK
Route 53alias → ALB
NETWORK
AWS ALBtarget group
COMPUTE
EKS pod 1streamhub-api
COMPUTE
EKS pod 2streamhub-api
COMPUTE
EKS pod NHPA scaled
L7 ALB terminates TLS, health-checks targets, and fans out to stateless pods.

StreamHub's API tier went stateless early: session data moved to Redis, uploaded files to S3, so any app instance could handle any request.

Java
# Health check endpoint every LB uses
curl -f http://app-3.internal:8080/health
# → 200 { "status": "ok", "db": "reachable", "redis": "reachable" }

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 5 sections

  • Stateless vs stateful tiers
  • Database scaling path
  • Auto-scaling
  • When vertical still wins
  • Cost and operational trade-offs

Test yourself

Answer these before moving on — recall is what makes it stick.