Load balancing simplifies the demand management from users by spreading the work evenly across multiple servers, minimizing the chances of individual server overloads. When a server gets too many requests that it could go offline or provide subpar performance, the load balancer acts as a reverse proxy, distributing client requests across all servers capable of fulfilling them appropriately. Therefore, it improves responsiveness and increases availability of applications.

Table of Contents

Type of Load Balancers in AWS

AWS has three types of load balancers –

  • Classic Load Balancer (CLB) – It operates at the transport level (OSI Layer 4) and directs traffic based on IP protocol data.
  • Application Load Balancer (ALB) – It functions at the application level (OSI Layer 7) and routes traffic based on HTTP/HTTPS information.
  • Network Load Balancer – Also works at transport level like CLB but it’s capable of handling millions of requests per second, and ultra-low latencies.
Metric CLB ALB NLB
Layer 4 7 4
Protocols TCP, SSL/TLS HTTP, HTTPS TCP, TLS, UDP, TCP_UDP
Performance High High Extremely High

AWS Application Load Balancer

Diving deeper into Application Load Balancer, it operates at the application layer, the seventh level of the Open Systems Interconnection (OSI) model. With ALB, users can direct microservices or containers, route HTTP and HTTPS traffic, and improve availability by spreading incoming traffic across multiple targets, such as Amazon EC2 instances.

Functionality of ALB

ALB analyses incoming HTTP and HTTPS traffic, and routes it to targets based on the content of the request. This content-based routing allows you to structure your application as smaller services (microservices), each service accessible through a unique path.

Using Application Load Balancer

Here’s a simple code to create an Application Load Balancer:

aws elbv2 create-load-balancer --name my-load-balancer \
--subnets subnet-b46032ec subnet-c602b3a3 subnet-17ec8f66

In addition, you would have to add listeners and register targets as per your requirement.

To conclude, understanding Load Balancer, especially ALB, is indispensable for the AWS Certified Solutions Architect – Associate exam. The knowledge of how AWS distributes application or network traffic efficiently helps design fault-tolerant and scalable systems.

Practice Test

The AWS Application Load Balancer is part of the load balancer family under AWS Elastic Load Balancing service.

– True
– False

Answer: True

Explanation: Application Load Balancer is indeed part of the Elastic Load Balancing service provided by AWS to distribute incoming application or network traffic across multiple targets.

The Application Load Balancer only supports path-based and host-based routing.

– True
– False

Answer: True

Explanation: The Application Load Balancer indeed supports path-based and host-based routing allowing it to route traffic based on the content of the request.

With the AWS Application Load Balancer, you can only route traffic to a single port on each container instance.

– True
– False

Answer: False

Explanation: Application Load Balancer allows a user to route traffic to multiple services on a single EC2 instance, using different ports for each service.

Load balancing does not improve application availability and fault tolerance.

– True
– False

Answer: False

Explanation: Load balancing greatly improves application availability and fault tolerance by distributing the workload across multiple resources.

AWS does not support cross-zone load balancing with the Application Load Balancer.

– True
– False

Answer: False

Explanation: AWS does support cross-zone load balancing with the Application Load Balancer, allowing requests to be distributed across registered targets in all enabled Availability Zones.

Which type of AWS Load Balancer is best suited for HTTP and HTTPS traffic?

– Network Load Balancer
– Application Load Balancer

Answer: Application Load Balancer

Explanation: The Application Load Balancer is designed to handle HTTP and HTTPS traffic and is best suited for load balancing of HTTP and HTTPS traffic, providing advanced request routing.

AWS Load Balancers do not support integration with AWS Certificate Manager for SSL termination.

– True
– False

Answer: False

Explanation: AWS Load Balancers do support integration with AWS Certificate Manager for SSL termination enabling secure communication.

AWS Application Load Balancer operates at which layer of the OSI model?

– Network Layer (Layer 3)
– Transport Layer (Layer 4)
– Application Layer (Layer 7)

Answer: Application Layer (Layer 7)

Explanation: AWS Application Load Balancer operates at Application Layer (Layer 7) of the OSI model and provides content-based routing support.

Elastic Load Balancing supports three types of load balancers. Which of the below is NOT one of them?

– Application Load Balancer
– Network Load Balancer
– Classic Load Balancer
– Target Group Load Balancer

Answer: Target Group Load Balancer

Explanation: AWS supports three types of load balancers: Application Load Balancer, Network Load Balancer, and Classic Load Balancer. Target Group Load Balancer doesn’t exist.

Load Balancers cannot apply security groups.

– True
– False

Answer: False

Explanation: In AWS, Load Balancers can apply security groups. This security measure acts as a virtual firewall, controlling the traffic for one or more EC2 instances.

Interview Questions

What is load balancing in AWS?

Load balancing in AWS is the process of distributing network traffic across multiple servers. This ensures no single server handles too much demand. AWS offers a feature called Elastic Load Balancing that automatically distributes incoming application traffic across multiple targets such as EC2 instances.

What are the types of load balancers in AWS?

AWS offers three types of load balancers: Application Load Balancer for HTTP and HTTPS traffic, Network Load Balancer for TCP traffic, and Classic Load Balancer for both HTTP/HTTPS and TCP traffic.

What is the purpose of Application Load Balancer in AWS?

Application Load Balancer is responsible for routing HTTP/HTTPS traffic to targets in its target groups based on the configured routing rules. It operates at the request level and can route traffic to targets based on the content of the request.

In which layer of OSI model does Application Load Balancer operate?

Application Load Balancer operates in the seventh layer of the OSI model, also known as the application layer.

What is path-based routing in Application Load Balancer?

Path-based routing allows you to route requests to specified applications based on the URL in the HTTP header. The Application Load Balancer evaluates the listener rules in priority order to determine which rule to apply, and then selects a target from the target group for the rule action.

How does sticky session work in Load Balancing?

Sticky sessions bind a user’s session to a specific target. When enabled, the load balancer uses a special cookie to associate the session with the original target instance. Subsequent requests from the user during the session are sent to the same target.

What is cross-zone load balancing in AWS?

Cross-zone load balancing in AWS equally distributes the traffic across all registered instances in all enabled availability zones, providing better workload distribution.

Can you change the type of Load Balancer after creation in AWS?

No, you cannot convert one type of load balancer to another after it has been created. However, you can migrate from Classic Load Balancer to either an Application Load Balancer or Network Load Balancer.

What is health check in the context of Load Balancer in AWS?

Health checks are used by AWS Load Balancer to determine the health status of the registered targets. If a health check fails, the Load Balancer stops sending traffic to the unhealthy target and starts routing traffic to healthy targets.

What is connection draining in AWS Load Balancing?

Connection draining is an ELB feature that allows in-flight requests to be served before the instance is deregistered or becomes unhealthy. It ensures that all requests are served and no connection is lost before the instance is taken out of service.

How does AWS Application Load Balancer handle HTTPS requests?

It terminates the connection at the load balancer, decrypts the request, and then sends it to the instances using HTTP. The load balancer uses a pre-configured SSL certificate to decrypt the request.

Can Application Load Balancer route requests to Lambda functions?

Yes, Application Load Balancer can now invoke Lambda functions to serve HTTP(S) requests, enabling users to access serverless applications from any HTTP client including web browsers.

Can an Application Load Balancer distribute traffic across multiple VPCs?

No, an Application Load Balancer can’t distribute traffic across multiple VPCs. All registered targets for an Application Load Balancer must be from the same VPC as the load balancer.

What is the purpose of Chain of Trust in Application Load Balancer?

The Chain of Trust ensures that the communication between the client and the server is secured. It includes the SSL certificate, the certificate of the CA that issued the SSL certificate, and all parent CA certificates up to the root certificate.

What are the benefits of using an Application Load Balancer?

Benefits include improved availability, increased scalability, enhanced security, support for multiple protocols and ports on the same instance, and intelligent request routing for modern application architectures.

Leave a Reply

Your email address will not be published. Required fields are marked *