Blog Amazon Web Services How does AWS Elastic Load Balancer Work?
AWS Elastic Load Balancer

How does AWS Elastic Load Balancer Work?

Amazon Web Services (AWS) is the market leader in cloud computing services presently without any doubts. The use of tools such as AWS Elastic Load Balancer (ELB) is popular nowadays for managing complex infrastructures with ease. The different functionalities of various tools on AWS provide unique advantages for AWS users.

However, the general assumption states that a load balancer is a mandatory component for any distributed system. The load balancer has the task of distributing traffic throughout the cluster of servers to ensure higher responsiveness and availability of applications, websites, or databases. Also, the load balancer is responsible for tracking the status of different resources during distributing requests.

If a specific server is not able to receive new requests or has a higher error rate or low responsiveness, then the load balancer will stop transmitting traffic to the server or concerned database. The following discussion would focus largely on the AWS load balancer alongside its details, such as working and pricing.

Preparing to become a certified AWS professional? Check our AWS Certifications Training Courses now!

Understanding AWS Load Balancer

The position of a load balancer is generally in the middle of the client and the server. Just like any other load balancer, the AWS Load balancer manages incoming network and application traffic. It also ensures the distribution of traffic through different backend servers by leveraging various algorithms.

As a result, a load balancer could help in reducing the load on the individual server through balancing application requests across multiple servers. The load balancer prevents the possibility of any application server transforming into a single point of failure. Therefore, a load balancer could ensure the improvement of the general responsiveness and availability of a specific application.

Now, let us define the AWS Elastic Load Balancer. The AWS ELB is an AWS service for automatic distribution of incoming application traffic among various Amazon EC2 instances. The AWS ELB helps in accomplishing a higher degree of fault tolerance. How? Through seamless provisioning of the amount of load balancing capacity required for distribution of application traffic.

The ELB identifies instances that are more likely to show errors and ensures automatic redirection of traffic to error-free instances. The redirection of traffic would continue until the restoration of error-vulnerable instances. Customers could choose to enable Elastic Load Balancing in a specific Availability Zone among multiple alternatives to ensure consistency in application performance.

AWS Elastic Load Balancer also finds application in the Amazon Virtual Private Cloud, where it helps in the distribution of traffic among application tiers in a virtual network. Now, let us take a look at the working of AWS ELB in detail for the next section in our discussion.

Preparing for AWS CSAA exam? Don’t forget to get prepared with EC2 (Elastic Compute Cloud). To help you along, here’s an exclusive EC2 Study Notes for you!

Working of Amazon elastic load balancer

As we noticed above, the load balancer takes incoming traffic from clients and then transfers the requests to the EC2 instances. One of the interesting highlights of how elastic load balancing works is evident in monitoring the health of registered targets, i.e., EC2 instances. This helps the load balancer in ensuring that it transmits requests to healthy instances.

We had just been through this in the above section while referring to error-prone instances, haven’t we? The next important aspect that you can note in the working of an AWS Elastic Load Balancer is the ‘listener.’ Users have to configure a load balancer for accepting inbound traffic through the specification of one or multiple listeners.

The definition of a listener implies a process that monitors connection requests. The configuration of a listener involves a protocol and the port number for connections from clients to the load balancer. Similarly, the load balancer configuration also involves a protocol and port number for connections from the load balancer to the instances.

Types of Elastic Load Balancers

Generally, you could find three different types of load balancers with the support of Elastic Load Balancing. The three types of load balancers include

  1. Application Load Balancers
  2. Network Load Balancers
  3. Classic Load Balancers

The configuration of these different load balancer types is different, which specifies the distinction among them.

In the case of the classic load balancers, you have to ensure registration of instances with a load balancer. On the other hand, in the case of Application Load balancers and Network Load balancers, you can register instances in instance groups. Then, you could divert traffic to the instance groups.

Code Deploy helps with the Continuous deployment process. Let’s explain how to use it to deploy code on EC2 Instances or on on-premise infrastructure.

Creation of load balancer node

Further introspection into the working of AWS Elastic Load Balancer shows that Elastic Load Balancing creates a load balancer node. But, in what circumstances? This happens upon enabling an Availability Zone for the load balancer.  Upon registering instances in an Availability Zone without activating the Availability Zone, registered instances do not receive any traffic.

The load balancer ensures a higher efficiency of load balancer by ensuring that every activated Availability Zone has one registered instance at the minimum. The recommended best practice is to enable multiple Availability Zones that can help in ensuring that the load balancer would continue to transfer traffic.

In case of any specific Availability Zone becoming unavailable or lack of healthy instances, the load balancer could help in transferring traffic to healthy instances in a different Availability Zone. Upon disabling a particular Availability Zone, the instances in the Availability Zone maintain their registration status with the load balancer. However, the load balancer will not route traffic to the registered instances in disabled Availability Zones.

OpsWork allows you to define and deploy a stack of components. Here’s how OpsWork stack looks and how to implement it!

Cross-zone load balancing

Another notable aspect of how elastic load balancing works refers to the functionalities of cross-zone load balancing. The nodes in a load balancer help in the distribution of requests from clients to registered instances. By enabling cross-zone load balancing, every load balancer node allocates traffic throughout all the registered instances in all the activated Availability Zones.

Disabling cross-zone load balancing results in each load balancer node distributing traffic only among the registered instances in relevant Availability Zone. In the case of Application Load Balancers, the cross-zone load balancing is always active.

On the other hand, Network Load Balancers have cross-zone load balancing disabled by default. Upon creation of a Network Load balancer, users could disable or enable cross-zone load balancing according to their requirements. When creating a Classic Load Balancer, the approach for the creation of the load balancer defines the default state of cross-zone load balancing.

However, you would note that in the case of the classic AWS Elastic Load Balancer, the API or CLI offer a disabled state of cross-zone load balancing by default. On the other hand, with the help of the AWS management console, the option for enabling cross-zone load balancing is active by default. After the creation of a Classic Load Balancer, users could enable or disable the cross-zone load balancing at any time.

Also Read: CNAME vs Alias

Request routing

Request routing is also another prominent aspect of the working of AWS Elastic Load Balancer. Request routing is evident before a client sends a request to the load balancer when the load balancer resolves its domain name using a DNS server. The DNS entry is subject to the control of Amazon since the load balancers exist in the “amazonaws.com” domain.

Amazon DNS servers provide one or multiple IP addresses to the client. The IP addresses correspond with the addresses of the load balancer nodes for your concerned load balancer. Elastic load balancing creates a network interface for every activated Availability Zone, with Network Load Balancers. All load balancer nodes in the Availability Zone utilize the network interface for obtaining a static IP address.

Users also have the option of associating one Elastic IP address with each network interface upon the creation of the load balancer. With the changes in application traffic, ELB can help in scaling the load balancer and updating the DNS entry. The specification of time-to-live of 60 seconds by the DNS entry also helps in ensuring the remapping of IP addresses quickly as a response to fluctuating traffic.

The client has to determine the IP address to use for sending requests to the load balancer. The working of AWS Elastic Load Balancer by leveraging the load balancer node receiving the request in the selection of a healthy registered instance. Then, the load balancer node sends the request to the target instances by using a private IP address.

Want to know more about Elastic Load Balancer? Just start a discussion at Whizlabs Forum to get answers by the experts.

Pricing of Elastic Load Balancer on AWS

One of the important aspects that is evident for this discussion is AWS load balancer pricing. The payment for using AWS ELB depends on usage, just like other AWS services. The payment is different for the unique types of load balancers. First of all, the Application Load Balancer and Network Load Balancer charge prices according to each hour or partial hour when the load balancer is running.

Another important factor in determining the price that you pay for load balancer usage is the number of Load Balancer Capacity Units (LCU) consumed per hour. The AWS load balancer pricing scheme for the Classic Load Balancer is slightly different. Apart from the charges for every hour or partial hour of using Classic Load Balancer, the pricing of classic load balancing also depends on each GB of data transferred through the load balancer.

Conclusion

So, based on the working of the AWS Elastic Load Balancer, you can note diverse benefits. The foremost element is security with the facility of various security features in load balancers on AWS. The security features include SSL/TLS decryption, integrated certificate management, and user authentication. The elastic load balancing capabilities could ensure adaptability to rapid fluctuations in network traffic patterns.

Furthermore, deep integration with Auto Scaling helps in validating substantial application capacity for addressing different levels of application load without any manual intervention. Flexibility and high availability are also some of the notable advantages in the case of elastic load balancing. So, there seems to be no reason to refrain from the use of Elastic Load Balancer, is there? 

If you are preparing for AWS certifications, Whizlabs AWS Certifications training courses will help you prepare and pass the certification exam. 

Join us now to become a certified AWS professional!

About Pavan Gumaste

Pavan Rao is a programmer / Developer by Profession and Cloud Computing Professional by choice with in-depth knowledge in AWS, Azure, Google Cloud Platform. He helps the organisation figure out what to build, ensure successful delivery, and incorporate user learning to improve the strategy and product further.

LEAVE A REPLY

Please enter your comment!
Please enter your name here