AlgoViz

Horizontal scaling

easy 25 min

Horizontal scaling, or scaling out, means adding machines and sharing the load between them.

Where it shows up

The same pattern appears across everyday software.

  • Web and API servers

    The standard case. Identical stateless instances behind a load balancer, with a minimum, a maximum and a target.

  • Search clusters

    Google's 2003 paper describes many commodity PCs, each holding part of the index, with copies to raise throughput and survive failures.

  • Background workers

    Workers reading from a queue scale on the backlog. Two workers or two hundred need no change to the producer.

  • Read-heavy databases

    A primary with several read replicas is the gentlest form of scaling a database out.

  • Content delivery

    Edge servers in many cities hold copies of static files. More places means both more capacity and shorter distances.

  • Kubernetes deployments

    The number of pods is a field. The Horizontal Pod Autoscaler changes it from metrics, and the Service sends traffic to the pods that are ready.