Horizontal Scaling and Load Balancing

A stateless API can be replicated across multiple instances behind a load balancer.

The load balancer distributes requests while health checks prevent traffic from reaching unhealthy instances.

Application-local memory should not be treated as shared state in a horizontally scaled service. Shared state belongs in appropriate external systems such as databases, distributed caches, queues, or object storage.

This is one reason REST statelessness is valuable for scalable services.

Horizontally Scaled API