ALB vs NLB vs GLB: AWS Load Balancer Guide
AWS Load Balancers distribute traffic across targets to ensure availability. Application Load Balancers (ALB) handle Layer 7 HTTP/HTTPS traffic, Network Load Balancers (NLB) manage Layer 4 TCP/UDP for high performance, and Gateway Load Balancers (GLB) deploy third-party virtual appliances. Choosing the right one depends on your specific protocol and performance needs.
Why do you even need a Load Balancer in AWS?
Listen, if you're studying for the CLF-C02, you'll see Elastic Load Balancing (ELB) mentioned everywhere. Think of a load balancer as a high-tech traffic cop. Instead of sending all your users to a single EC2 instance—which would eventually crash under pressure—the load balancer spreads that traffic across multiple targets in different Availability Zones.
This isn't just about handling more users; it's about high availability. If one server goes down, the load balancer simply stops sending traffic there, ensuring your users never see a '404 Not Found' or a timeout error. For the exam, remember that ELB is a key component of a 'fault-tolerant' architecture, allowing you to scale horizontally by adding more instances as demand spikes.
When should you use an Application Load Balancer (ALB)?
The ALB is your go-to for modern web applications. Because it operates at Layer 7 (the Application Layer) of the OSI model, it is 'intelligent.' It doesn't just pass packets; it actually looks at the HTTP/HTTPS request to decide where to send the traffic. This allows for advanced routing features like path-based routing (sending /api requests to one group of servers and /images to another) or host-based routing.
If you're building a microservices architecture or a standard website, the ALB is almost always the right choice. It handles the heavy lifting of SSL termination and supports WebSockets, making it incredibly versatile for developers. Just remember for the test: ALB = Layer 7 = HTTP/HTTPS.
Why is the Network Load Balancer (NLB) the choice for high performance?
When milliseconds matter and you're dealing with millions of requests per second, you move down to Layer 4. The NLB operates at the Transport Layer, meaning it only cares about TCP, UDP, and TLS traffic. It doesn't peek inside the HTTP packet, which is why it's blisteringly fast and offers ultra-low latency.
One huge advantage of the NLB that often pops up on exam questions is the ability to provide a static IP address per Availability Zone. This is critical for clients who need to whitelist a specific IP in their firewall. If your scenario involves non-web protocols or requires extreme performance and stability, the NLB is your winner. Think: NLB = Layer 4 = Raw Speed.
What exactly is a Gateway Load Balancer (GLB) used for?
The GLB is the 'specialist' of the group. You won't use this for a standard web app or a database. Instead, the GLB is designed to deploy and scale third-party virtual appliances. Imagine you want to route all your incoming traffic through a specialized firewall, an Intrusion Detection System (IDS), or a deep-packet inspection tool from a vendor like Palo Alto or Check Point.
Unlike the ALB or NLB, the GLB operates at Layer 3 (the Network Layer). It acts as a single entry point for your security appliances, ensuring that traffic is inspected before it ever reaches your application servers. It simplifies the management of these 'bump-in-the-wire' appliances so you don't have to manually manage IP addresses for every new security instance you launch.
How do Health Checks keep your application from crashing?
A load balancer is only as good as its knowledge of the backend. This is where Health Checks come in. The ELB periodically sends a 'ping' or an HTTP request to each registered target to see if it's still breathing. If a target fails to respond correctly a certain number of times, the load balancer marks it as 'unhealthy' and immediately stops sending it traffic.
This process is automatic and happens in the background. Once the instance recovers and passes the health checks again, the load balancer seamlessly puts it back into the rotation. Without this mechanism, your users would randomly hit dead servers, leading to a terrible user experience. For the CLF-C02, associate Health Checks with 'Self-Healing' and 'High Availability' architectures.
How do you master these concepts for the CLF-C02 exam?
Knowing the definitions is one thing; applying them to a tricky exam scenario is another. AWS loves to give you a scenario—like 'a company needs a static IP for a high-performance TCP application'—and ask you to pick the right balancer. That's where raw reading stops being enough and active practice takes over.
At Cert Sensei, we've built the ultimate toolkit for this. We provide 1,000 expert-curated AWS Cloud Practitioner (CLF-C02) practice questions that mirror the actual exam's difficulty. You won't just get a 'correct' or 'incorrect' mark; you'll get detailed expert reasoning for every single answer, explaining why the right choice is right and why the distractors are wrong. Plus, our domain-level analytics show you exactly where you're weak—whether it's Load Balancers or Billing—so you can stop wasting time on what you already know.
❓ Frequently Asked Questions
Can I use an ALB for non-HTTP traffic like gaming protocols?
No. ALBs are strictly for Layer 7 traffic (HTTP/HTTPS). For gaming protocols, VoIP, or any raw TCP/UDP traffic, you must use a Network Load Balancer (NLB) which operates at Layer 4.
Does an NLB provide a static IP address?
Yes. One of the primary reasons to choose an NLB over an ALB is that it provides a static IP address for each Availability Zone, which is essential for certain firewall configurations.
Which load balancer should I use for a third-party firewall?
You should use the Gateway Load Balancer (GLB). It is specifically designed to route traffic to and from third-party virtual appliances while maintaining the original packet's destination.