When do you choose an ALB and when an NLB in AWS?
BeginnerScenarioLoad Balancing, Proxies & CDN
Answer
Situation read → Different products for different protocols and needs.
What I'd do →
- ALB for HTTP/HTTPS, path or host routing, gRPC, WebSockets, authentication, WAF integration
- NLB for TCP, UDP or TLS passthrough, static or Elastic IPs per AZ, millions of requests per second, ultra low latency
- Use NLB in front of an ALB if you need static IPs for an HTTP app
- Check with
aws elbv2 describe-load-balancers
Why → ALB works at layer 7 with rich routing; NLB works at layer 4 with performance and IP guarantees.
Interview tip → Mention PrivateLink requires an NLB or GWLB, which is a common reason to pick NLB.
More on Load Balancing, Proxies & CDN
What is the difference between a Layer 4 and a Layer 7 load balancer?BeginnerForward proxy versus reverse proxy: what is the difference?BeginnerHow do health checks work on a load balancer and what makes a good one?BeginnerWhat are sticky sessions and why would you avoid them?BeginnerWhat does a CDN do and when does it help?BeginnerYour app sees the load balancer's IP instead of the real client IP. How do you get the real one?Beginner