What is the difference between L4 and L7 load balancing?
IntermediateConceptLoad Balancers, Proxies & CDNs
Answer
L4 balances connections using IP and port, without parsing payload: very fast, preserves protocols like raw TCP, TLS passthrough and UDP. L7 terminates the connection and understands HTTP, so it can route by host and path, rewrite headers, handle auth, do canaries and retry.
AWS: NLB is L4 (millions of requests per second, static IPs, preserves source IP), ALB is L7 (host/path rules, WebSockets, gRPC, OIDC auth, WAF).
More on Load Balancers, Proxies & CDNs
What is a load balancer and why do we use one?BeginnerCompare ALB, NLB, GWLB and Classic Load Balancer in AWS.IntermediateWhat load-balancing algorithms are common?BeginnerWhat are health checks and how should they be designed?AdvancedWhat is connection draining (deregistration delay)?IntermediateWhat are sticky sessions and what are the drawbacks?Intermediate