Scalingscale outscaling out

Horizontal scaling

Definition

Horizontal scaling adds instances of a component and distributes work among them, typically behind a load balancer or through partitioning.

In practice

It has no hard ceiling and improves availability, since losing one of many instances removes only a fraction of capacity. It works best for stateless services, where any instance can handle any request.

State is the hard part: sessions, caches and databases must be shared, replicated or partitioned before they can scale out. More instances also mean more network calls, more coordination and more ways to fail partially.

Example

An API tier grows from 4 to 12 identical containers during a sale, each handling about a twelfth of traffic behind the same load balancer.