You are on page 1of 2

Elastic Load Balancing

elb-icon.png
General
Elastic Load Balancing automatically distributes incoming application traffic
across multiple targets, such as
Amazon EC2 instances, containers, and IP addresses.
There are three types of Elastic Load Balancer (ELB) on AWS:

Classic Load Balancer (CLB) – this is the oldest of the three and provides basic
load balancing at both
layer 4 and layer 7. (DEPRECATED)
Application Load Balancer (ALB) – layer 7 load balancer that routes connections
based on the content of
the request.
Network Load Balancer (NLB) – layer 4 load balancer that routes connections based
on IP protocol data.
Elastic Load Balancing provides fault tolerance for applications by automatically
balancing traffic across
targets – Amazon EC2 instances, containers, and IP addresses – and Availability
Zones while ensuring only healthy
targets receive traffic.
An ELB can distribute incoming traffic across your Amazon EC2 instances in a single
Availability Zone or
multiple Availability Zones.

ELB Security Groups


Security groups control the ports and protocols that can reach the front-end
listener.
In non-default VPCs, you can choose which security group to assign.
You must assign a security group for the ports and protocols on the front-end
listener.
You need to also allow the ports and protocols for the health check ports and back-
end listeners.

ELB Monitoring
CloudWatch - every 1 minute
Access Logs (disabled by default)
CloudTrail (captures API calls)
Application Load Balancer
Supports HTTP, HTTPS, WebSocket
Automatically scales but not instantly
Uses round-robin load balancing algorithm
Can route to AWS or on-prem resources
Perform health checks to resources to redirect traffic if needed
EC2 Instance can get user data from data in headers (X-Forwarded-From)
Content-Based Routing allows the routing of requests to a service based on the
content of the request:

Host-based routing – route client requests based on the Host field of the HTTP
header allowing you to
route to multiple domains from the same load balancer.
Path-based routing – route a client request based on the URL path of the HTTP
header (e.g. /images or
/orders).
Stickiness
The same client goes to the same instance
Done with a cookie that has TTL(Time to Live)
Used so users do not lose session data
This can cause an imbalance in traffic
Target Groups
EC2
ECS
Lambda
private IP address
Network Load Balancer
high performance
less latency than ALB
one static IP address per AZ (supports Elastic IP)
use case: extreme performance or need for TCP/UDP requests
EC2 Instance thinks the request is coming from the client and not the NLB

You might also like