ALB vs NLB
Layer 7 application load balancing versus Layer 4 network load balancing on AWS.
Overview
What is being compared
Both are AWS load balancers, and each solves a distinct set of problems. The Application Load Balancer works at Layer 7: it terminates HTTP and HTTPS connections and routes on content. The Network Load Balancer works at Layer 4: it passes TCP and UDP connections through to targets with very low latency and without modifying packet headers.
The table puts the two side by side on the points that decide most designs.
- OSI layer — 7, HTTP and HTTPS — 4, TCP and UDP
- Connection — Terminated and inspected — Passed through without inspection
- Routing — Path, host, query string, headers — Flows to targets
- Features — Sticky sessions, authentication, WebSocket, AWS WAF — TLS pass-through, non-HTTP protocols
- Client IP at target — In X-Forwarded-For — Preserved natively
- IP addresses — Dynamic, reach it by DNS name — Static Elastic IP per AZ
- Latency — Adds 1 to 5 ms for HTTP parsing and rules — Sub-millisecond
Sign up free to read the full topic
More Comparisons topics
Start free on Cariara · Coding problems · System design studio