Tech Terms Explained Open in the app →

Horizontal Scaling

Architecture · Intermediate · 4 min read

What is it?

Horizontal scaling means handling more load by adding more machines, rather than making one machine bigger.

Explain like I'm 5

Horizontal scaling is like hiring more cashiers when the store gets busy, instead of trying to make one cashier work faster and faster.

Why was it created?

A single machine has limits and is a single point of failure. Horizontal scaling spreads load across many machines for capacity and resilience.

Where is it used?

  • Web and API server fleets
  • Distributed databases
  • Stateless cloud services
  • High-traffic platforms

Why should developers care?

It's the foundation of large-scale, highly available systems, so it comes up constantly in system design.

How does it work?

You run multiple instances of a service behind a load balancer, which spreads requests across them. Adding instances increases capacity; if one fails, the others keep serving.

Real-world example

A site that gets a traffic surge launches more identical web servers behind its load balancer, then shuts them down when traffic drops.

Common use cases

  • Scaling stateless services
  • Handling traffic spikes
  • Improving availability
  • Growing beyond one machine's limits

Advantages

  • Near-unlimited growth potential
  • Improves fault tolerance
  • Pay for capacity as needed
  • No single point of failure

Disadvantages

  • Apps must be designed to scale out (ideally stateless)
  • Shared state and sessions need care
  • More operational complexity

When should you use it?

When demand can exceed one machine and you want resilience and elastic capacity.

When should you avoid it?

When a single larger machine (vertical scaling) is simpler and sufficient for the load.

Alternatives

Vertical scaling (a bigger machine)Caching to reduce load

Related terms

Vertical ScalingLoad BalancerHigh AvailabilityDistributed Systems

Interview questions

Beginner

  • What is horizontal scaling?
  • How does it differ from vertical scaling?

Intermediate

  • Why are stateless services easier to scale horizontally?
  • What role does a load balancer play?

Senior

  • How do you handle shared session state when scaling out?
  • What are the limits of horizontal scaling?

Common misconceptions

  • "You can just add servers to any app to scale it" — apps must be designed to run as multiple instances.
  • "Horizontal scaling always beats vertical" — sometimes a bigger machine is simpler and enough.

Fun facts

  • Scaling out is the term for adding machines; scaling up means making one bigger.
  • Stateless services are the easiest to scale horizontally because any instance can handle any request.

Timeline

  • 2000s — Web-scale companies popularize scaling out on commodity hardware

Learning resources

Quick summary

Horizontal scaling adds more machines to handle load, providing elastic capacity and resilience for systems designed to run as multiple instances.

Cheat sheet

  • Add machines, not bigger ones
  • Run many instances behind a balancer
  • Best with stateless services
  • Improves capacity and fault tolerance

If you remember only one thing

Horizontal scaling adds more machines to share load — the basis of large, resilient systems.