The Computing Series

Tradeoffs

AT6 — Generality vs. Specialisation

Layer 4 load balancing is general: it works for any TCP/UDP protocol and has minimal overhead. Layer 7 is specialised: it understands HTTP and can make content-aware decisions — route /api/v2 to new servers, route /api/v1 to old servers during a migration. The cost of specialisation is overhead: each Layer 7 connection requires terminating TLS, parsing HTTP headers, and making a routing decision before forwarding.

AT5 — Centralisation vs. Distribution

A centralised load balancer is simple to configure and monitor. It is also a bottleneck: all traffic must pass through it. At very high throughput (millions of RPS), a single load balancer becomes the bottleneck. The solution is to distribute: multiple load balancers behind DNS round-robin or anycast. Distributed load balancing eliminates the bottleneck but makes configuration, health state, and session affinity harder to manage consistently.


Read in the book →