0
0
AWScloud~10 mins

ALB vs NLB decision in AWS - Visual Side-by-Side Comparison

Choose your learning style9 modes available
Process Flow - ALB vs NLB decision
Start: Incoming Client Request
Choose Load Balancer Type
Application Load Balancer
Inspect HTTP/HTTPS
End Decision
This flow shows how a client request is routed through either an Application Load Balancer (ALB) or a Network Load Balancer (NLB) based on protocol and use case.
Execution Sample
AWS
Client sends HTTPS request
Load Balancer inspects request
If HTTP/HTTPS -> ALB routes by URL
If TCP/UDP -> NLB routes by IP/port
This example shows how the load balancer type is chosen based on the incoming request protocol and how it routes traffic accordingly.
Process Table
StepIncoming Request ProtocolLoad Balancer Type ChosenRouting MethodUse Case
1HTTPSALBRoute by URL, Host, HeadersWeb apps, microservices
2TCPNLBRoute by IP, PortExtreme performance, static IP
3UDPNLBRoute by IP, PortLow latency, millions of connections
4HTTPALBRoute by URL, Host, HeadersSupports WebSockets, HTTP/2
5Unknown ProtocolNoneNo routingRequest rejected or error
💡 Execution stops when request protocol is identified and routed or rejected if unsupported.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
Incoming Request ProtocolNoneHTTPSTCPUDPHTTPUnknown
Load Balancer TypeNoneALBNLBNLBALBNone
Routing MethodNoneURL/Host/HeadersIP/PortIP/PortURL/Host/HeadersNone
Use CaseNoneWeb appsPerformanceLow latencyWebSocketsRejected
Key Moments - 3 Insights
Why does ALB route based on URL and headers but NLB routes based on IP and port?
ALB works at the application layer (HTTP/HTTPS) so it can inspect URL and headers (see execution_table rows 1 and 4). NLB works at the transport layer (TCP/UDP) and routes by IP and port without inspecting content (rows 2 and 3).
What happens if the incoming request uses an unsupported protocol?
The load balancer cannot route the request, so it is rejected or causes an error (see execution_table row 5). This is why protocol detection is critical.
Why choose NLB for extreme performance and static IPs?
NLB operates at a lower network layer, handling millions of connections with very low latency and supports static IP addresses (rows 2 and 3), making it ideal for high-performance needs.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what load balancer type is chosen for an HTTPS request at step 1?
ANLB
BALB
CNone
DBoth ALB and NLB
💡 Hint
Check the 'Load Balancer Type Chosen' column in execution_table row 1.
At which step does the load balancer reject the request due to unsupported protocol?
AStep 2
BStep 3
CStep 5
DStep 4
💡 Hint
Look for 'No routing' or 'Rejected' in the 'Routing Method' and 'Use Case' columns.
If the incoming request protocol changes from TCP to HTTP, how does the routing method change according to the execution_table?
AFrom IP/Port to URL/Host/Headers
BFrom URL/Host/Headers to IP/Port
CNo change in routing method
DRouting method becomes None
💡 Hint
Compare routing methods in rows 2 (TCP) and 4 (HTTP) of the execution_table.
Concept Snapshot
ALB vs NLB Decision:
- ALB handles HTTP/HTTPS at app layer, routes by URL, headers
- NLB handles TCP/UDP at network layer, routes by IP and port
- Choose ALB for web apps, microservices, WebSockets
- Choose NLB for high performance, static IP, millions of connections
- Unsupported protocols cause request rejection
Full Transcript
This visual execution shows how AWS load balancers decide routing based on incoming request protocols. When a client sends a request, the system checks the protocol. If it is HTTP or HTTPS, the Application Load Balancer (ALB) is chosen. ALB routes traffic by inspecting URL, host, and headers, supporting web applications and microservices. If the protocol is TCP or UDP, the Network Load Balancer (NLB) is chosen. NLB routes traffic by IP address and port, providing high performance and static IP support. If the protocol is unsupported, the request is rejected. Variables like Incoming Request Protocol, Load Balancer Type, Routing Method, and Use Case change step-by-step as the request is processed. Key moments clarify why ALB and NLB route differently and what happens with unsupported protocols. The quiz tests understanding of load balancer choice and routing methods based on protocol.