2. What is Elastic Load Balancing (ELB)?
• ELB distributes incoming traffic across multiple targets such as EC2
Instances, containers and IP Addresses.
ELB
EC2
INSTANCE
EC2
INSTANCE
EC2
INSTANCE
3. What are the different ELB Products?
• Classic Load Balancer (CLB)
- built within the EC2-Classic network
- HTTP, HTTPS and TCP
• Application Load Balancer (ALB)
- flexible application management
- HTTP and HTTPS (VPC)
• Network Load Balancer (NLB)
- High performance and static IP
- TCP Workloads (VPC)
4. Layer 4 (network)
• Supports TCP.
• Incoming client connection
bound to server connection.
• No header modification.
• Source IP is preserved.
Layer 7 (application)
• Supports HTTP and HTTPS.
• Connection terminated at the load
balancer and pooled to the server.
• Headers maybe modified.
• X-forwarded-For header contains
client IP Address.
5. What is Network Load Balancer (NLB)?
• Connection based load balancing at layer 4 (TCP).
• Extremely low latencies / High throughput
• Supports Static IP
• Supports Elastic IP
• Ideal for long running applications
• Preserve Source IP
• DNS Failover / Availability Zone Failover
• Integrates with Route 53 on NLB IP
6. What are the steps to create an NLB?
• Create the Network Load Balancer
• Create Listener (Protocol and Port)
• Create Target Groups
• Create Targets (Instance or IP)
• Configure Security Group
Inbound
Source Port Range Comment
Client IP Instance Listener Allow traffic from clients on the instance listener port
VPC CIDR or
Private IP of NLB
Health check Allow traffic from the load balancer on the health
check port.
7. Migrating to Network Load Balancer?
• As simple as creating an NLB, registering targets and updating DNS to
point at the new CNAME.
• One step migration on Amazon ELB Dashboard.
8. NLB IP Address and Firewall
• Automatically gets a single IP per Availability Zone (AZ).
• Assign an Elastic IP per AZ to get Static IP.
• Static IP for use cases on White-listing for Firewalls and Zero Dollar
billing use cases.
• Preserves Source IP for features like Geo-IP Blocking.
• Internal ELB doesn’t change IPs.
9. Health Checks
• It supports both Network and Application Target health checks.
Health checks ensure that request traffic is shifted away from a failed
instance.
ELB
EC2
INSTANCE
EC2
INSTANCE
EC2
INSTANCE
10. Availability Zone Failover
• If an AZ is down, it will failover the DNS to only the EIP of the working
AZ.
NLB
EC2
INSTANCE
EC2
INSTANCE
Zone A
Zone B
NLB
100.1.1.100
50.1.1.100
100.1.1.100
50.1.1.100
ROUTE 53 X
11. Comparison of Different ELBs
Feature Application Load Balancer Network Load Balancer Classic Load Balancer
Protocols HTTP, HTTPS TCP TCP, SSL, HTTP, HTTPS
Platforms VPC VPC EC2-Classic, VPC
Health checks ✔ ✔ ✔
CloudWatch metrics ✔ ✔ ✔
Logging ✔ ✔ ✔
Zonal fail-over ✔ ✔ ✔
Connection draining (deregistration delay) ✔ ✔ ✔
Load Balancing to multiple ports on the same
instance
✔ ✔
WebSockets ✔ ✔
IP addresses as targets
✔ ✔
Load balancer deletion protection ✔ ✔
12. Comparison of Different ELBs
Path-Based Routing ✔
Host-Based Routing ✔
Native HTTP/2 ✔
Configurable idle connection timeout ✔ ✔
Cross-zone load balancing ✔ ✔
SSL offloading ✔ ✔
Server Name Indication (SNI) ✔
Sticky sessions ✔ ✔
Back-end server encryption ✔ ✔
Static IP ✔
Elastic IP address ✔
Preserve Source IP address ✔