load balancer

Load Balance

Elastic Load Balancing (ELB)

Elastic Load Balancing (ELB) is an essential part of a cloud application for routing different types of traffic according to various application requirements and disaster recovery. A cloud architecture with ELB can automatically distribute and balance the incoming traffic across cloud resources such as  EC2 instances, IP addresses, and containers in different availability zones (AZ).

Amazon offers four types of load balancers that differ in which type of traffic they can balance: Application Load Balancers (ALB), Network Load Balancers (NLB), Gateway Load Balancers (GWLB), and Classic Load Balancers (CLB).  

Fig 1: Elastic Load Balancers

Amazon ELB Architecture

An ELB consists of listeners and target groups. A listener listens to the traffic of a specific protocol that comes to a specific port. A target group is the load balancer’s cloud resources to distribute traffic to. The load balancer checks for the health of the registered targets and only routes traffic for healthy resources. A listener rule defines how to route the traffic to the registered targets.

 

For example, say an Application Load Balancer has been configured to listen to incoming HTTP traffic from port 80, and a listener rule is defined to route traffic based on the client IP addresses. Upon receiving the traffic, the listener evaluates the rule’s conditions and distributes the traffic to the appropriate target satisfying the conditions.

Fig 2: ELB High-level Architecture

Cross-Zone Load Balancing

When cross-zone load balancing is enabled for a load balancer, it will distribute traffic in equal percentages across all the targets. The following example illustrates this concept. Each load balancer routes 50% of the traffic to all registered targets, and each of the five targets located in two Availability Zones gets 20% of all traffic.

Fig 3: Cross-Zone Load Balancing Example With ELB

Without cross-zone load balancing, each target in Availability Zone A will get 25% of the traffic. Each target in Availability Zone B will get 16.67% of the traffic as each LB can route traffic only to the targets in its Availability Zone.

ELB Use Cases

Route traffic based on request content

Content-based routing is essential for applications that consist of several services. ELB allows you to route traffic to different services according to the content of the HTTP request, such as HTTP header, method, host field, URL path, Source IP address, and Query string. 

Disaster Recovery

Health checks help load balancer nodes to keep track of the healthy targets across all the availability zones. Network Load Balancers can perform DNS fail-over if it finds there are no healthy targets. Also, if the Network Load Balancer in an Availability Zone becomes unhealthy, Route 53 will automatically fail-over and direct the traffic to a healthy NLB in another Availability Zone.

Route traffic to specific targets

Load balancer sticky sessions allow you to direct traffic from the same clients to the same target when you need to route specific traffic to specific targets. Load balancers enable sticky sessions through duration-based and application-based cookies.

Deploy, scale, and manage virtual appliances

Your applications may contain different virtual appliances such as Intrusion Detection Systems (IDS), firewalls, and Deep Packet Inspectors. Gateway Load Balancers allow you to distribute traffic across such virtual appliances while automatically scaling the appliance according to the traffic demand.

How Second Spectrum has simplified their business using ELB

 

Second Spectrum, which provides intelligent tracking technologies for sports, has utilized an Application Load Balancer to efficiently execute its previously executed workloads in their Kubernetes clusters. First, they migrated their workloads to amazon managed Elastic Kubernetes Service (EKS) to simplify the operation of cluster workloads.

 

Next, the company identified the opportunity to develop an integrated solution using an Application Load Balancer controller to share an Application Load Balancer with multiple applications. Using the Application Load Balancer with EKS, they could cut down 90% of its cluster hosting costs, mitigate errors by 75% and increase the application response time and staff productivity.

Summary

Amazon ELB is a must-have component of modern cloud-based web applications. It enables applications to route traffic based on different conditions for different target groups. As discussed in this article, an ELB has a broad set of use cases for traffic routing and disaster recovery. You can also integrate ELBs for your applications and direct your traffic accordingly to meet your requirements.

Leave a Comment

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