Concepts
This helps to ensure that no single server bears too much demand, improving the responsiveness and availability of applications. For those preparing for the AWS Certified Solutions Architect – Associate exam, understanding how load balancing works within AWS is crucial.
Types of Load Balancers in AWS
AWS provides several types of load balancers, each tailored for specific use cases:
- Classic Load Balancer (CLB): This is the legacy load balancer offering basic load balancing across EC2 instances. It supports both HTTP/HTTPS and TCP traffic.
- Application Load Balancer (ALB): Suitable for HTTP/HTTPS traffic, ALB offers advanced request routing based on the content of the request, which makes it ideal for modern application architectures, including microservices and container-based applications.
- Network Load Balancer (NLB): Designed for TCP, UDP, and TLS traffic where extreme performance is required. NLBs operate at the connection level and are capable of handling millions of requests per second while maintaining ultra-low latencies.
- Gateway Load Balancer (GWLB): It helps you deploy, scale, and manage a fleet of third-party virtual appliances, such as firewalls and intrusion detection systems.
Understanding the distinction between them is vital when architecting systems in AWS.
Application Load Balancer (ALB)
An Application Load Balancer functions at the application layer (Layer 7 in the OSI model). It provides several features that are particularly beneficial for web applications:
- Content-Based Routing: ALB can route traffic based on content, such as URL path or hostname.
- Host-Based Routing: Route traffic to different backend services based on the hostname in the requested URL.
- Path-Based Routing: Differentiate between different application paths to route traffic to the correct service.
- HTTP/2 and WebSocket Support: Allows for persistent connections, which are ideal for real-time communication applications.
- Native IPv6 Support: ALB can process requests from clients over IPv6.
- Connection Draining: Gradually de-register instances, ensuring that ongoing requests are not interrupted.
- Health Checks: ALB performs health checks on the target group’s instances to ensure traffic is only sent to healthy instances.
Example: Content-Based Routing with ALB
When configuring an ALB, you can set up listener rules that define how incoming requests should be routed to target groups. Here’s an example setup:
- Listener: Listens on port 80 (HTTP).
- Target Group A: Contains EC2 instances serving the path
/images
. - Target Group B: Contains EC2 instances serving the API at
/api
.
Listener rules would look something like this:
- If the URL contains
/images
, route to Target Group A. - If the URL starts with
/api
, route to Target Group B.
Comparison of Load Balancers
Feature | ALB | NLB | CLB |
---|---|---|---|
Protocol support | HTTP/HTTPS | TCP, UDP, TLS | HTTP/HTTPS, TCP |
Performance | High | Highest | Moderate |
Routing Based on Content | Yes | No | Limited |
SSL Offloading | Yes | Yes (TLS listeners) | Yes |
Fixed Hostname | Yes | Yes | No |
Path-Based Routing | Yes | No | No |
IP as a target | No | Yes | No |
Health Check | Advanced | Basic | Basic |
Supported Platforms | EC2, ECS, Lambda | EC2 | EC2 |
WebSockets & HTTP/2 | Yes | No | No (WebSockets only) |
Note: This table provides a side-by-side comparison but AWS’s services are evolving, and features may be added or updated.
Conclusion
For candidates studying for the AWS Certified Solutions Architect – Associate exam, understanding load balancing with ALB is essential. ALB is particularly suited to modern, high-traffic web applications with specific routing needs. As you study, focus on the use cases for each load balancer type, their features, and how they integrate with AWS services. This knowledge will not only help with the exam but also in designing resilient and scalable architectures on AWS.
Answer the Questions in Comment Section
True or False: An Application Load Balancer operates at the OSI model layer
- False
False
An Application Load Balancer operates at OSI model layer 7 which allows it to perform more complex load balancing based on attributes such as HTTP headers, cookies, and URI.
Which of the following are types of load balancers offered by AWS? (Select THREE)
- a) Classic Load Balancer (CLB)
- b) Application Load Balancer (ALB)
- c) Network Load Balancer (NLB)
- d) Distributed Load Balancer (DLB)
a, b, c
AWS offers three types of load balancers: Classic Load Balancer (CLB), Application Load Balancer (ALB), and Network Load Balancer (NLB).
True or False: An Application Load Balancer only supports IPv4 addresses.
- False
False
An Application Load Balancer supports both IPv4 and IPv6 addresses for client communication.
Which feature is supported by an Application Load Balancer but NOT by a Classic Load Balancer?
- a) Sticky sessions
- b) Load balancing to multiple ports on the same instance
- c) SSL offloading
- d) Static IP addresses
b
An Application Load Balancer can route traffic to multiple ports on the same instance, which is not supported by the Classic Load Balancer.
True or False: Application Load Balancers can perform host-based routing and path-based routing.
- True
True
Application Load Balancers can route traffic based on the domain name (host-based) and the URL path (path-based).
Which AWS service would you use to distribute incoming application traffic across multiple targets, such as EC2 instances, in multiple Availability Zones?
- a) Amazon Route 53
- b) AWS Auto Scaling
- c) Amazon CloudFront
- d) AWS Elastic Load Balancing
d
AWS Elastic Load Balancing, which includes Application Load Balancer, is the service designed to distribute incoming traffic across multiple targets in different Availability Zones.
True or False: Application Load Balancers can directly route traffic to AWS Lambda functions.
- True
True
Application Load Balancers can directly invoke AWS Lambda functions to serve HTTP(S) requests enabling serverless architectures.
True or False: Network Load Balancer is best suited for load balancing of HTTP and HTTPS traffic.
- False
False
The Network Load Balancer (NLB) is optimized for TCP, UDP, and TLS traffic where extreme performance is required, while the Application Load Balancer (ALB) is better suited for HTTP/HTTPS traffic.
True or False: An Application Load Balancer can be deployed within a VPC only.
- True
True
Application Load Balancers are designed to be deployed within a Virtual Private Cloud (VPC) to distribute traffic to resources within that VPC.
What metric would you primarily monitor to assess the performance of an Application Load Balancer?
- a) CPU utilization
- b) Request latency
- c) Network in/out
- d) Disk I/O
b
The key performance indicator for an Application Load Balancer is request latency, which measures the time taken to process and respond to incoming requests.
Which of the following features does an Application Load Balancer NOT support?
- a) WebSockets
- b) Server Name Indication (SNI)
- c) Fixed hostname
- d) SSL termination
c
An Application Load Balancer does not support a fixed hostname as it is designed for high availability and scalability with a DNS name that resolves to multiple IP addresses.
True or False: Security groups can be associated with an Application Load Balancer to control traffic.
- True
True
Security groups act as virtual firewalls for ALBs, allowing you to control which traffic can reach the load balancer.
Great post on Load Balancing concepts! Really helped clarify the differences between ALB and NLB for the SAA-C03 exam.
Can anyone explain how AWS ALB handles session stickiness?
I think the blog post missed out on target groups for ALB. That’s a crucial component!
Thanks for the useful information!
Great article on Application Load Balancers! Very helpful for my study.
Can someone explain the difference between CLB and ALB in simple terms?
This post really helped me understand the Listener Rules in ALB. Thanks!
Could anyone provide a practical example of Path-Based Routing using ALB?