Elastic Load Balancer
-
Managed Load Balancer.
-
Costs less to setup your own load balancer; but is more efforts.
-
Integrated with many AWS services / offerings.
-
AWS has four managed load balancers:
- Classic Load Balancer
- Application Load Balancer
- Network Load Balancer
- Gateway Load Balancer
Load Balancer Security Groups

Application Load Balancer
- Layer 7 (Application layer)
- Multiple HTTP applications across machines (target goups)
- Multiple applications on the same machine (containers)
- Supports for HTTP/2 and WebSocket.
- Support redirects (eg., from HTTP to HTTPS)
- Routing to different target groups based on URL path, hostname, query string and headers.
- Great for micro services and container based applications (Docker and Amazon ECS)
Target Groups
- EC2 instances, ECS tasks, Lambda Functions, IP Addresses
- Health checks are at the target group level.
Network Load Balancer
- Allow forward TCP & UDP traffic to instances
- Handle millions of requests per seconds.
- Ultra-low latency.
- One static IP / AZ.
- Supports assigning Elastic IP
Target Groups
- EC2 instances, IP Addresses, Application Load Balancer
- Health checks support the TCP, HTTP and HTTPS Protocols.
Gateway Load Balancer
- Operates at level 3 (Network Layer)

Target Groups
- EC2 Instances
- IP Addresses
Sticky Sessions
- Client is always redirected to the same instance.
- "Cookie" is used for stickiness and it has an expiration date.
- May bring imbalance to the load.
Application-based Cookies
Custom cookie
- Generated by the application
- Name must be specified for each target group.
Application cookie
- Generated by load balancer
Duration-based Cookies
- Generated by load balancer.
Cross-Zone Load Balancing

- For Application Load Balancer: Enabled be default; can be disabled at Target Group Leve; no charges.
- For Network Load Balancer and Gateway Load Balancer: Disabled be default; extra charges.
SSL Certificates

- Manage certificates using AWS Certificate Manager.
- Alternatively, upload your own certificate.
Server Name Indication (SNI)
- Solves the issue of loading multiple SSL certificates to serve multiple websites.
- Requires client to indicate the hostname of the target server in the initial SSL handshake.

Deregistration Delay
- Time to complete in-flight requests while the instance is unhealthy.
- Stops sending the request to that instance.
- Default to 300 seconds (1 to 3600 seconds); can be disabled (set to 0).