Load Balancing & Scaling
Horizontal and vertical scaling strategies, load balancing algorithms, and auto-scaling patterns
Vertical scaling: add CPU, memory, or disk to a single machine. Pros: simpler operationally, shared memory for coordination.
Cons: limited by hardware, single point of failure, larger capital expense upfront. Horizontal scaling: add more machines.
Pros: nearly unlimited scalability, fault tolerance, incremental cost. Cons: distributed systems complexity, eventual consistency, coordination overhead.
Modern cloud architecture favors horizontal because it is more resilient and cost-effective. Netflix and Google use horizontal scaling; small startups might begin with vertical.
Best practice: design for horizontal scaling from the start, but use vertical scaling for database masters during early growth.
Key Takeaways
Visual Diagram
Single server -> Multiple servers (horizontal) vs Bigger server (vertical)