- Published on
AWS Elastic Load Balancers (ELB)
- Authors
- Name
- Chloe McAree (McAteer)
- @ChloeMcAteer3
This is part of a blog series giving a high level overview of the different services examined on the AWS Solution Architect Associate exam, to view the whole series click here.
ELB Summary
Designed to help balance the load of incoming traffic by distributing it across multiple targets to help improve scalability.
Can balance load across one or more Availability Zones.
Internal Load Balancers are load balancers that are inside private subnets
Load Balancers have their own DNS name — you will NEVER be given an IP address
X-Forward-For header → use if you need to get the IPv4 address of your end user
Cross Zone load Balancing → can enable all EC2 instances to get equal share of traffic no matter what zone they are in!
Path Patterns → can direct traffic to different EC2 instances based on request URL.
Types of ELB’s
AWS offers four different types of ELBs, all of which are highly available and can be used to make your application fault tolerant.
1. Application Load Balancer
Best suited for HTTP & HTTPS traffic
Operates at Layer 7 (Application layer of the OSI model)
Routes traffic based on request content. It is Intelligent and can send specific requests to specific servers.
Secure as it uses SSL/TLS ciphers and protocols
2. Network Load Balancer
Best suited for TCP & UDP traffic
Used when extreme performance is required
Operates at Layer 4 (Transport layer of the OSI model)
Can handle millions of requests per second (ultra-low latency)
3. Classic Load Balancers
Used to balance the load across multiple EC2 instances.
Can operate at both Layer 7 (Application layer) and Layer 4 (Transport layer).
Not very intelligent — it can’t route traffic based on content like Application Load Balancers.
4. Gateway Load Balancer
For scaling virtual applications e.g. firewalls.
Operates at Layer 3 (Network layer of the OSI model)
Automatically scales virtual appliances based on demand.
Sticky Sessions
Also known as Session Affinity
Allows you to bind a users session to a specific instance, ensuring all requests in that specific session are sent to the same instance.
If you are writing to an EC2 instance or disk, you will want to enable sticky sessions.