Concepts

Load balancing is a critical concept in the architecture of scalable, high-availability systems. An Application Load Balancer (ALB) is one of the types of load balancers offered by Amazon Web Services (AWS) and is specially designed for web applications with HTTP and HTTPS traffic.

What is Load Balancing?

In the realm of computing, load balancing refers to efficiently distributing incoming network traffic across a group of backend servers, known as a server farm or server pool. This ensures no single server bears too much demand. By spreading the requests, load balancing improves the responsiveness and availability of applications, websites, or databases.

Types of Load Balancers in AWS

AWS offers three types of load balancers that suit different use cases:

  • Application Load Balancer (ALB): Optimized for HTTP/HTTPS traffic, operates at Layer 7, and provides advanced request routing targeted at building modern application architectures.
  • Network Load Balancer (NLB): Operates at Layer 4, suitable for TCP, UDP, and TLS traffic where extreme performance is required.
  • Classic Load Balancer (CLB): Offers basic load balancing across multiple Amazon EC2 instances and operates at both Layer 4 and Layer 7.

Application Load Balancer Overview

The Application Load Balancer is best suited for load balancing of HTTP and HTTPS traffic, allowing it to handle advanced routing, session persistence, and SSL termination. ALBs can also route requests based on content type, making them highly effective in modern multi-tier applications.

Key Features of ALB

  • Content-Based Routing: ALB can route requests based on content within the request. This includes URLs, headers, and even body fields.
  • Host-Based Routing: Traffic routing based on the domain name in the request.
  • Path-Based Routing: ALB can route traffic based on the URL path.
  • HTTP/2 and WebSocket Support: It supports these protocols which are beneficial for real-time, full-duplex communication channels over a single TCP connection.
  • Health Checks: ALB performs health checks on EC2 instances and ensures traffic is routed only to healthy instances.
  • SSL Offloading: It can terminate SSL connections and encrypt/decrypt data packets, taking the burden off of the backend servers.

Example of ALB in AWS Architecture

An example scenario could be a web application where you expect to handle user requests for different services such as user authentication, file upload, and data retrieval. You can set up an ALB to handle such requests that come in through your domain.

How to Set Up an ALB

  1. Define the target groups for your instances based on the service they provide, such as “Authentication Service” or “File Service”.
  2. Create the ALB in the AWS Management Console and choose the appropriate listeners and protocols (HTTP or HTTPS).
  3. Configure the routing rules. For example, requests to auth.yourdomain.com can be directed to the “Authentication Service” target group.
  4. Assign EC2 instances to the target groups.
  5. Update the health checks accordingly for each service.
  6. Deploy the ALB and modify your DNS records to point to the new ALB.

Here is an example of how routing priority works in ALB:

Priority Host Header Path Pattern Target Group
1 auth.yourdomain.com /login LoginService
2 api.yourdomain.com /files/upload UploadService
3 * / GeneralService

Conclusion

The Application Load Balancer is an AWS service that offers high performance and flexibility for modern web applications. It comes with features that can be used to implement a sophisticated routing approach, leading to optimized load distribution and better fault tolerance. Understanding how to use ALBs is essential for a Solutions Architect working with AWS. Deploying it effectively can ensure your web application is scalable, secure, and highly available, making knowledge of ALBs crucial for achieving the AWS Certified Solutions Architect – Associate (SAA-C03) certification.

Answer the Questions in Comment Section

True or False: An Application Load Balancer operates at the OSI model’s Layer 7 and can perform content-based routing.

  • A) True
  • B) False

Answer: A) True

Explanation: An Application Load Balancer functions at Layer 7 which is the application layer of the OSI model, allowing it to route traffic based on content (such as URL paths).

Which of the following are types of load balancers provided by AWS? (Select TWO)

  • A) Classic Load Balancer
  • B) Application Load Balancer
  • C) Direct Connect Load Balancer
  • D) Network Load Balancer

Answer: A) Classic Load Balancer, B) Application Load Balancer

Explanation: AWS provides three types of load balancers: Classic Load Balancer (CLB), Application Load Balancer (ALB), and Network Load Balancer (NLB). Direct Connect Load Balancer does not exist.

True or False: An Application Load Balancer can route traffic to multiple HTTP applications across different EC2 instances.

  • A) True
  • B) False

Answer: A) True

Explanation: An Application Load Balancer can distribute incoming application traffic across multiple targets, such as EC2 instances, in different Availability Zones.

What is the primary benefit of using an Application Load Balancer compared to a Classic Load Balancer?

  • A) Operates at Layer 4 only
  • B) Support for static IP addresses
  • C) Content-based routing
  • D) Supports TCP traffic only

Answer: C) Content-based routing

Explanation: The Application Load Balancer supports advanced request routing based on the content of the request, which is not a feature of the Classic Load Balancer.

True or False: Application Load Balancers can perform health checks on the EC2 instances to which they route traffic.

  • A) True
  • B) False

Answer: A) True

Explanation: ALBs can be configured to perform health checks and route traffic only to the healthy instances.

Which AWS service would you use to distribute traffic across multiple AWS Regions?

  • A) Application Load Balancer
  • B) Classic Load Balancer
  • C) Amazon Route 53
  • D) Network Load Balancer

Answer: C) Amazon Route 53

Explanation: Amazon Route 53, a scalable Domain Name System (DNS) web service, can route user requests to infrastructure in multiple AWS Regions.

True or False: An Application Load Balancer cannot provide an HTTPS listener.

  • A) True
  • B) False

Answer: B) False

Explanation: An Application Load Balancer supports listeners for both HTTP and HTTPS protocols. It can also manage SSL/TLS certificates.

Application Load Balancers support which protocol(s)? (Select TWO)

  • A) HTTP
  • B) SSH
  • C) HTTPS
  • D) FTP

Answer: A) HTTP, C) HTTPS

Explanation: Application Load Balancers support both HTTP and HTTPS protocols for load balancing. They do not support SSH or FTP directly.

True or False: To ensure high availability, it is a best practice to deploy your load balancer across multiple Availability Zones.

  • A) True
  • B) False

Answer: A) True

Explanation: Deploying a load balancer across multiple Availability Zones ensures that the load balancer can route traffic to healthy targets in the case of a failure in one zone.

What is a Listener in the context of an Application Load Balancer?

  • A) A rule that defines how traffic is redirected
  • B) A process that checks the health of the target groups
  • C) A component that monitors the load balancer usage
  • D) A configuration that specifies a protocol and port number for connections from clients to the load balancer

Answer: D) A configuration that specifies a protocol and port number for connections from clients to the load balancer

Explanation: In an ALB, a listener checks for connection requests from clients, using the protocol and port that you configure, and forwards requests to one or more target groups based on the rules defined.

When using an Application Load Balancer, which is the correct target type for routing traffic to individual IP addresses in one or more subnets?

  • A) Instances
  • B) IP Addresses
  • C) Lambda Functions
  • D) Containers

Answer: B) IP Addresses

Explanation: When configuring an ALB, you can route traffic to targets registered by IP address, including targets in peered VPCs, on-premises instances, or Elastic Network Interfaces (ENIs) in any subnet of the VPC for the load balancer.

True or False: Sticky sessions, which bind a user’s session to a specific instance, are supported by Application Load Balancers.

  • A) True
  • B) False

Answer: A) True

Explanation: Sticky sessions (session affinity) enable the load balancer to bind a user’s session to a specific target, which is useful for ensuring that all requests from a user during the session are sent to the same target. This is supported by ALBs using HTTP/HTTPS protocols.

0 0 votes
Article Rating
Subscribe
Notify of
guest
28 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Tvorimir Domashovec
7 months ago

Great post on Application Load Balancer in AWS. Helped me understand the basics for my SAA-C03 exam.

Teresa Moura
6 months ago

I am still confused about the difference between Application Load Balancer and Network Load Balancer. Any thoughts?

Alice Abraham
6 months ago

How does the sticky session feature work with Application Load Balancer?

Elena Šakić
6 months ago

Thank you for clarifying the difference between ALB and NLB.

محمدمهدی گلشن

This blog is a life-saver for exam prep!

Alfredo Hughes
7 months ago

Anything notable to focus on regarding ALB for the SAA-C03 exam specifically?

Mostafa Huse
6 months ago

I appreciate the detailed explanation of Load Balancer types. Helped a lot!

Carmen Hayes
6 months ago

Not looking forward to memorizing all the load balancing concepts for the exam.

28
0
Would love your thoughts, please comment.x
()
x