AWS offers three types of elastic load balancers with each designed for a specific use case. In this section we will learn about these AWS service offerings, what they do, how they are different, and which load balancer in the family is the best fit for a given requirement.
Tables 1.1 through 1.6 show a side-by-side feature comparison of the load balancer products currently offered by AWS.
TABLE 1.1 AWS ELB Product Comparisons: ELB Types
Feature | Application Load Balancer | Network Load Balancer | Gateway Load Balancer | Classic Load Balancer |
Load balancer type | Layer 7 | Layer 4 | Layer 3 gateway + layer 4 load balancing | Layer 4/7 |
Target type | IP, instance, Lambda | IP, instance, Application Load Balancer | IP, instance | |
Terminates flow/proxy behavior | Yes | Yes | No | Yes |
Protocol listeners | HTTP, HTTPS, gRPC | TCP, UDP, TLS | IP | TCP, SSL/TLS, HTTP, HTTPS |
Reachable via | VIP | VIP | Route table entry | VIP |
TABLE 1.2 AWS ELB Product Comparisons: Layer 7
Feature | Application Load Balancer | Network Load Balancer | Gateway Load Balancer | Classic Load Balancer |
Load balancer type | Layer 7 | Layer 4 | Layer 3 gateway + layer 4 load balancing | Layer 4/7 |
Redirects | ✔ | |||
Fixed response | ✔ | |||
Desync mitigation mode | ✔ | |||
HTTP header-based routing | ✔ | |||
HTTP/2gRPC | ✔ |
TABLE 1.3 AWS ELB Product Comparisons: Characteristics
Feature | Application Load Balancer | Network Load Balancer | Gateway Load Balancer | Classic Load Balancer |
Load balancer type | Layer 7 | Layer 4 | Layer 3 gateway + layer 4 load balancing | Layer 4/7 |
Common configurations and characteristics | ||||
Slow start | ✔ | |||
Outpost support | ✔ | |||
Local zone | ✔ | |||
IP address – static, elastic | ✔ | |||
Connection draining (deregistration delay) | ✔ | ✔ | ✔ | ✔ |
Configurable idle connection timeout | ✔ | ✔ | ||
PrivateLink support | ✔ (TCP, TLS) | ✔ (GWLBe) | ||
Zonal Isolation | ✔ | ✔ | ||
Session resumption | ✔ | ✔ | ||
Long-lived TCP connection | ✔ | ✔ | ||
Load balancing to multiple ports on the same instance | ✔ | ✔ | ✔ | |
Load balancer deletion protection | ✔ | ✔ | ✔ | |
Preserve source IP address | ✔ | ✔ | ✔ | |
WebSockets | ✔ | ✔ | ✔ | |
Supported network/platforms | VPC | VPC | VPC | EC2-Classic, VPC |
Cross-zone load balancing | ✔ | ✔ | ✔ | ✔ |
IAM permissions(resource, tag based) | ✔ | ✔ | ✔ | ✔ (Only resource-based) |
Flow stickiness (All packets of a flow are sent to one target, and return traffic comes from same target) | Symmetric | Symmetric | Symmetric | Symmetric |
Target failure behavior | Fail close on targets, unless all targets are unhealthy (fail open) | Fail close on targets, unless all targets are unhealthy (fail open) | Existing flows continue to go to existing target appliances, new flows are rerouted to healthy target appliances | |
Health checks | HTTP, HTTPS, gRPC | TCP, HTTP, HTTPS | TCP, HTTP, HTTPS | TCP, SSL/TLS, HTTP, HTTPS |
Security | ||||
SSL offloading | ✔ | ✔ | ✔ | |
Server Name Indication (SNI) | ✔ | ✔ | ||
Backend server encryption | ✔ | ✔ | ✔ | |
User authentication | ✔ | |||
Custom security policy | ✔ | |||
ALPN | ✔ | ✔ |
TABLE 1.4 AWS ELB Security
Feature | Application Load Balancer | Network Load Balancer | Gateway Load Balancer | Classic Load Balancer |
Load balancer type | Layer 7 | Layer 4 | Layer 3 gateway + layer 4 load balancing | Layer 4/7 |
Security | ||||
SSL offloading | ✔ | ✔ | ✔ | |
Server Name Indication (SNI) | ✔ | ✔ | ||
Backend server encryption | ✔ | ✔ | ✔ | |
User authentication | ✔ | |||
Custom security policy | ✔ | |||
ALPN | ✔ | ✔ |
TABLE 1.5 AWS ELB Kubernetes Controller
Feature | Application Load Balancer | Network Load Balancer | Gateway Load Balancer | Classic Load Balancer |
Load balancer type | Layer 7 | Layer 4 | Layer 3 gateway + layer 4 load balancing | Layer 4/7 |
Kubernetes controller | ||||
Direct-to-pod | ✔ | ✔ (Fargate pods) | ||
Load balance to multiple namespaces | ✔ | |||
Support for fully private EKS clusters | ✔ | ✔ |
TABLE 1.6 AWS ELB Logging and Monitoring
Feature | Application Load Balancer | Network Load Balancer | Gateway Load Balancer | Classic Load Balancer |
Load balancer type | Layer 7 | Layer 4 | Layer 3 gateway + layer 4 load balancing | Layer 4/7 |
Logging and monitoring | ||||
CloudWatch metrics | ✔ | ✔ | ✔ | ✔ |
Logging | ✔ | ✔ | ✔ | ✔ |