AWS Elastic Load Balancing
Deciding between Layer 7, Layer 4, and Layer 3
ALB: APPLICATION
NLB: NETWORK
GLB: GATEWAY
The Ingredients: Traffic Types
What kind of data are you serving?
Layer 7: Application
Handles high-level requests like HTTP, HTTPS, and gRPC. It looks at the content of the message.
- URL Path Routing
- Host Header Routing
- User Cookies
Layer 4: Transport
Handles raw connections like TCP, UDP, and TLS. It focuses on speed and performance.
- Ultra-low Latency
- Millions of RPS
- Static/Elastic IPs
Layer 3: Network
Handles IP Packets. Used for transparently passing traffic through security appliances.
- Firewall Inspection
- Intrusion Detection
- Bump-in-the-wire
The Traffic Flow Process
Visualizing how traffic hits the OSI layers
ALB Process
Terminates SSL, inspects headers, and routes to specific target groups based on URL paths.
NLB Process
Passes traffic through with zero inspection. Best for handling sudden spikes and massive loads.
GLB Process
Acts as a single entry/exit point for traffic. Routes to 3rd party firewalls for deep packet inspection.