Octet

ALB, NLB and GWLB. What is each one for?

Show the answer

Say this first

An Application Load Balancer works at layer 7: it terminates HTTP and HTTPS, routes on host, path and headers, and always opens a new connection to the target, passing the client IP in X-Forwarded-For. A Network Load Balancer works at layer 4 for TCP, UDP and TLS, gives one static IP per AZ, handles very high rates with low latency, and can preserve the client IP. A Gateway Load Balancer sends traffic to firewall appliances inline, wrapped in GENEVE on UDP 6081.

Go deeper

ALBNLBGWLB
Layer7 (HTTP, HTTPS, gRPC)4 (TCP, UDP, TLS)3, transparent
RoutingHost, path, header, query, methodPort and protocolAll traffic to appliances
Static IPNo, use the DNS nameOne per AZ, or Elastic IPsNot addressed by clients
Client IP at targetIn X-Forwarded-ForPreserved for instance targets by defaultOriginal packet inside GENEVE
Typical useWeb apps, microservices, WAFNon-HTTP, extreme rates, PrivateLink servicesInline firewalls and IDS

Notes that come up

  • ALB node addresses change. Partners who need a fixed IP get an NLB, or Global Accelerator in front.
  • An NLB can be the front of a PrivateLink endpoint service; an ALB cannot by itself (you can put an ALB behind an NLB as a target).
  • GWLB is used with GWLB endpoints placed as route targets in VPC route tables, so traffic is steered to the appliance fleet and back without changing addresses.

Other clouds

AWSAzureGCP
ALBApplication Gateway (regional), Front Door (global)Application Load Balancer
NLBAzure Load Balancer (Standard)Network Load Balancer, passthrough or proxy
GWLBGateway Load BalancerInternal passthrough Network LB as a route next hop
Route 53 DNS steeringTraffic ManagerCloud DNS routing policies

Traps

  • Saying an ALB has a static IP.
  • Putting UDP traffic behind an ALB. An ALB speaks HTTP only; UDP services need an NLB.
How did you do?Book 9.1 Traditional Applications