AWS Elastic Load Balancer (ELB)

AWS Elastic Load Balancer (ELB)

Table of contents

No heading

No headings in the article.

Let’s explore Amazon Web Services (AWS) Elastic Load Balancing (ELB), which is a fully managed service that automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, IP addresses, and Lambda functions.

ELB ensures that your applications are highly available and offer consistent performance. It scales your load balancer as traffic to your application changes over time and can automatically scale to the vast majority of workloads.

🎯𝐓𝐲𝐩𝐞𝐬 𝐨𝐟 𝐄𝐥𝐚𝐬𝐭𝐢𝐜 𝐋𝐨𝐚𝐝 𝐁𝐚𝐥𝐚𝐧𝐜𝐞𝐫𝐬

AWS offers three types of load balancers, each tailored to specific needs:

1️⃣ 𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐋𝐨𝐚𝐝 𝐁𝐚𝐥𝐚𝐧𝐜𝐞𝐫 (𝐀𝐋𝐁): Best suited for load balancing of HTTP and HTTPS traffic, ALB operates at Layer 7 of the OSI model. It offers advanced routing features, such as host-based or path-based routing, and can route requests to microservices or container-based applications.

2️⃣ 𝐍𝐞𝐭𝐰𝐨𝐫𝐤 𝐋𝐨𝐚𝐝 𝐁𝐚𝐥𝐚𝐧𝐜𝐞𝐫 (𝐍𝐋𝐁): Ideal for load balancing of TCP, UDP, and TLS traffic where extreme performance is required. NLB operates at Layer 4 of the OSI model and is capable of handling millions of requests per second while maintaining ultra-low latencies.

3️⃣ 𝐂𝐥𝐚𝐬𝐬𝐢𝐜 𝐋𝐨𝐚𝐝 𝐁𝐚𝐥𝐚𝐧𝐜𝐞𝐫 (𝐂𝐋𝐁): This is the legacy ELB and provides basic load balancing across multiple Amazon EC2 instances. It operates at both Layer 4 and 7. While it’s still in use for certain applications, AWS recommends using ALB or NLB for new applications.

🛠️ 𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬

• 𝐇𝐢𝐠𝐡 𝐀𝐯𝐚𝐢𝐥𝐚𝐛𝐢𝐥𝐢𝐭𝐲: ELB automatically distributes incoming application traffic across multiple targets in multiple Availability Zones reducing the risk of overloading a single resource.

• 𝐇𝐞𝐚𝐥𝐭𝐡 𝐂𝐡𝐞𝐜𝐤𝐬: ELB monitors the health of its registered instances and routes traffic only to the healthy instances.

• 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬: ELB works seamlessly with Amazon Virtual Private Cloud (VPC) and AWS Certificate Manager for SSL termination, providing enhanced security for your applications.

• 𝐈𝐧𝐭𝐞𝐠𝐫𝐚𝐭𝐢𝐨𝐧 𝐰𝐢𝐭𝐡 𝐨𝐭𝐡𝐞𝐫 𝐀𝐖𝐒 𝐒𝐞𝐫𝐯𝐢𝐜𝐞𝐬: ELB integrates with many AWS services like Amazon EC2, Auto Scaling, AWS CloudTrail, and others to enhance the manageability and scalability of applications.

• 𝐒𝐜𝐚𝐥𝐚𝐛𝐢𝐥𝐢𝐭𝐲: ELB is capable of scaling in and out automatically based on incoming traffic patterns.

𝐀 𝐬𝐜𝐞𝐧𝐚𝐫𝐢𝐨 𝐭𝐡𝐚𝐭 𝐢𝐥𝐥𝐮𝐬𝐭𝐫𝐚𝐭𝐞𝐬 𝐭𝐡𝐞 𝐮𝐬𝐞 𝐨𝐟 𝐀𝐖𝐒 𝐄𝐥𝐚𝐬𝐭𝐢𝐜 𝐋𝐨𝐚𝐝 𝐁𝐚𝐥𝐚𝐧𝐜𝐞𝐫:

📚 𝐒𝐜𝐞𝐧𝐚𝐫𝐢𝐨: Media Streaming Application
Imagine you’re operating a popular media streaming application. Your application is hosted on multiple EC2 instances to handle the high volume of incoming traffic. These instances are located across multiple Availability Zones in the AWS cloud to provide high availability and fault tolerance.

Your application serves both HTTP and HTTPS traffic, and the demand varies significantly throughout the day, peaking during evening hours when most users are active.

🚀 𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐋𝐨𝐚𝐝 𝐁𝐚𝐥𝐚𝐧𝐜𝐞𝐫 (𝐀𝐋𝐁)
Given the nature of your application, you decide to use an Application Load Balancer (ALB). The ALB efficiently distributes incoming HTTP and HTTPS traffic to your EC2 instances based on the content of the request. This is known as path-based routing.

For example, requests for www.mystreamapp.com/movies are routed to a group of EC2 instances (Target Group A) that are optimized for streaming movies. Simultaneously, requests for www.mystreamapp.com/music are routed to a different group of EC2 instances (Target Group B) that specialize in streaming music.

🛡️ Security
To ensure secure communication, you use AWS Certificate Manager to provision an SSL certificate, and you configure your ALB to terminate the SSL connections. This way, all data between your clients and your load balancer is encrypted.

🌐 High Availability and Scalability
Your ALB is configured to perform health checks on all registered instances. If an EC2 instance becomes unhealthy, the load balancer stops sending traffic to it, maintaining a high-quality user experience.

As your user base grows, you can add more EC2 instances to your target groups. The ALB will automatically distribute the load across all healthy instances, ensuring that your application scales effectively to meet demand.

This scenario demonstrates how ELB can provide high availability, security, and scalability for your application, ensuring that your users get the best possible experience.

AWS Elastic Load Balancing is a powerful tool to ensure your applications deliver high performance and are highly available to your end-users. It’s a key component in any resilient and scalable architecture on AWS.

Thank you for reading. If you have any questions or would like to share your experiences with AWS ELB, feel free to comment below! 💬