Chapter 10

Load Balancing and Proxies

Proxies, load balancers, and CDNs are all reverse proxies wearing different hats — this chapter takes them apart layer by layer.

5 topics

Every box in this chapter is a variation on one idea: put a machine between the client and the real server so it can read, route, cache, or decrypt the traffic before passing it on. A reverse proxy fronts your backends and becomes their public face; a load balancer is a reverse proxy that picks a backend; a CDN is a fleet of caching reverse proxies spread across the planet. Learn the proxy and the rest are specializations.

The decisions here shape the rest of your architecture. Whether you balance at layer 4 or layer 7 dictates how TLS is handled and what you can route on. Where you terminate TLS dictates who sees plaintext. How you cache at the edge dictates whether a deploy serves stale assets for hours. The five topics move from the proxy concept, through the load-balancing layers and algorithms, to TLS handling and global edge caching — the front door of a modern service, taken apart piece by piece.

One shape, many specializations: the reverse proxy in front of a backend pool
client
reverse proxy / LB
one of N backends

Topics in This Chapter