Spreading traffic across servers.
What it does
A load balancer receives requests and forwards each to a healthy backend server. It hides the fleet behind one address, enables horizontal scaling and removes failed servers via health checks.
Algorithms
• Round robin: rotate through servers.
• Least connections: pick the least busy.
• IP hash: same client goes to same server.
• Weighted: bigger servers get more traffic.
Layer 4 vs Layer 7
L4 balances on IP/port and is very fast. L7 understands HTTP, so it can route by path, header or cookie, terminate TLS and do smarter things at higher cost. The balancer itself must be redundant to avoid being a single point of failure.