Cloud

Building block · 9 min

Load balancing

Layer 4 and layer 7 balancers, global front doors, and the pricing units that surprise people.

Every cloud sells three kinds of load balancer, under different names. A layer 4 balancer moves TCP and UDP connections and never reads the request. A layer 7 balancer terminates HTTP, reads paths and headers, and picks a backend per request. A global entry point spreads traffic across Regions, either with one anycast IP address or with DNS. Knowing which kind you are looking at explains most of the behaviour, and most of the bill.

The concepts are in load balancers, stateless servers and routing traffic across Regions. This page compares the products.

Side by side

AWS Google Cloud Azure Self-hosted
Layer 7, regional Application Load Balancer Regional external Application Load Balancer (Envoy-based) Application Gateway Envoy, nginx, HAProxy
Layer 4, regional Network Load Balancer External passthrough Network Load Balancer (built on Maglev) Azure Load Balancer IPVS, HAProxy in TCP mode, GitHub's GLB
Global, single IP Global Accelerator (layer 4, anycast) or CloudFront Global external Application Load Balancer (layer 7, one anycast IP) Front Door (layer 7); cross-region Load Balancer (layer 4) Anycast with BGP from your own PoPs
Global, DNS Route 53 routing policies Cloud DNS routing policies Traffic Manager GeoDNS
What you pay per Hours plus capacity units (LCU for ALB, NLCU for NLB) Varies by load balancer type; check its pricing page Varies by service and tier; check its pricing page Servers and your time