Load Balancing
A load balancer sits between clients and your servers, distributing incoming requests so no single server is overwhelmed. Without one, horizontal scaling gives you capacity that clients cannot reach. With one, you can add or remove servers transparently — clients always hit the same address. Load balancers use different algorithms to route requests. Round-robin cycles through servers sequentially. Least-connections routes to the server with the fewest active requests — better when requests vary in duration. Consistent hashing maps clients to servers deterministically, minimising cache misses when the server pool changes. Layer 7 load balancers can also route based on URL path or headers — sending `/api/*` to one cluster and static assets to another.