Enquire Now

Thanks for the like! We're thrilled you enjoyed the article. Your support encourages us to keep sharing great content!

Cloud

AWS - Load Balancer 

Load balancing is the job of dividing network traffic among a set of resources that host an application in an even manner. Contemporary applications need to host millions of users at a time and deliver each user the right text, video, photos, and other data promptly and reliably. In order to host this kind of high volume of traffic, most applications utilize numerous resource servers with identical content mirrored across them. A load balancer is a device that sits between the user and the server set and acts as an invisible broker to keep all of the resource servers in use in proportion.

Benefits of Load Balancer

1. High Availability & Fault Tolerance

Automatically distributes incoming traffic across multiple targets (EC2 instances, containers, IP addresses) in different Availability Zones.Ensures that if one instance fails, traffic is redirected to healthy instances, reducing downtime.

2. Scalability

Supports auto-scaling to handle varying traffic loads dynamically.Works seamlessly with AWS Auto Scaling to add or remove instances based on demand.

3. Improved Performance

Supports content-based routing (e.g., forwarding requests based on URL path, host headers, or query parameters).HTTP/2 and WebSocket support for optimized performance.

4. Security

  • Integrates with AWS Shield and AWS Web Application Firewall (WAF) for DDoS protection.

  • Supports SSL/TLS termination to offload encryption/decryption from backend servers.

  • Works with AWS Identity and Access Management (IAM) for fine-grained access control.

5. Cost Optimization

  • Reduces the need for complex third-party load balancers.

  • Optimizes resource utilization, ensuring cost-effective infrastructure.

6. Supports Different Protocols & Services

  • Works with HTTP, HTTPS, WebSocket, TCP, UDP, and gRPC protocols.

  • Supports integration with AWS Lambda for serverless computing.

7. Ease of Management

  • Fully managed by AWS, requiring minimal manual configuration.

  • Provides detailed monitoring and logging via Amazon CloudWatch.

  • Offers health checks to ensure traffic is only routed to healthy instances.

Types of Load Balancers

Classic Load Balancer: It is the traditional form of load balancer which was used initially. It distributes the traffic among the instances and is not intelligent enough to support host-based routing or path-based routing. It ends up reducing efficiency and performance in certain situations. It is operated on the connection level as well as the request level. Classic  Load Balancer is in between the transport layer (TCP/SSL) and the application layer (HTTP/HTTPS).

Application Load Balancer: This type of Load Balancer is used when decisions are to be made related to  HTTP and HTTPS traffic routing. It supports path-based routing and host-based routing. This load balancer works at the Application layer of the OSI Model. The load balancer also supports dynamic host port mapping.

Network Load Balancer: This type of load balancer works at the transport layer(TCP/SSL) of the OSI model. It’s capable of handling millions of requests per second.  It is mainly used for load-balancing TCP traffic.

Gateway Load Balancer: Gateway Load Balancers provide you the facility to deploy, scale, and manage virtual appliances like firewalls. Gateway Load Balancers combine a transparent network gateway and then distribute the traffic.

Types of Load Balancers Technology

Hardware load balancers

A hardware load balancer is a device that can handle and deliver safely gigabytes of traffic to hundreds of different servers. You can install it in your data centers and utilize virtualization to set up multiple digital or virtual load balancers that you can centrally manage.

Software load balancers

Software load balancers are applications which perform all duties of a load balancer. You can place them on any server or make use of them as a full-managed third-party service.

Comparison of software load balancers and hardware balancers

Hardware load balancers require an initial installation, setup, and upkeep. You can also not put them to capacity, especially if you purchase one simply to manage peak-hour traffic spikes. In case traffic level suddenly spikes over its present capacity, this will affect users until you can purchase and install another load balancer.

However, software load balancers are a lot more adaptable. They are very easy to scale up and down and are cloud-friendly. They are cheaper to install, maintain, and operate in the long run as well.

How does AWS help with load balancing?

Elastic Load Balancing (ELB) is a fully managed load balancer that directs incoming application traffic securely to several targets and virtual appliances in AWS and on-premises environments. You can scale cloud-natured applications without the requirement for intricate configurations or API gateways with it. You can use ELB to configure four forms of software load balancers.

  • An application load balancer routes traffic for HTTP-based requests.
  • A network load balancer distributes traffic across IP addresses. It is most appropriate for load balancing TCP and User Datagram Protocol (UDP)-based requests.
  • A Gateway Load Balancer directs traffic to third-party virtual appliances. It is ideal for merging a third-party appliance, such as a network firewall, with your network traffic in an easy and scalable way.
  • A Classic Load Balancer routes traffic to applications in the Amazon EC2-Classic network—a flat network that you and other customers share.

Advantages : 

  • ELB distributes incoming application traffic across multiple targets, like EC2 instances, containers, and IP addresses, automatically to enable high availability.
  • It can scale automatically to meet changes in traffic patterns, enabling you to keep your applications performing consistently.
  • It can monitor the health of the registered targets and direct traffic to only the healthy targets.

It loads traffic consistently over all availability zones within an area, enhancing fault tolerance.
Disadvantages

  • ELB adds latency to your application since traffic has to go through the load balancer before it is forwarded to your targets.
  • It does not offer much scope for customization, so you might need to employ other tools and services in order to satisfy your application fully.
  • It can add extra complexity to your application design, and you'll need to deal with and support extra resources.
  • It can raise your total AWS bill, particularly if you get a lot of traffic or need multiple load balancers.

step-by-step guide on how to set up an AWS Load Balancer:

Step 1: Log in to AWS Console and Go to the AWS Management Console.

Navigate to EC2 Dashboard. In the left navigation pane, click on Load Balancers.

Step 2: Choose the Load Balancer Type

AWS provides three main types of Load Balancers:

  • Application Load Balancer (ALB) – Best for HTTP/HTTPS traffic.
  • Network Load Balancer (NLB) – Best for TCP/UDP traffic with high performance.
  • Classic Load Balancer (CLB) – Legacy option, not recommended for new applications.

For web applications, Application Load Balancer is recommended.

Step 3: Configure Listeners and Availability Zones, VPC

Step 4 : choose Listener and routing and secure listener settings

Step 5 : Review all Configurations and Click Create Load Balancer

 

Sridhar S

Author

Sridhar S

Cloud Admin - Chadura Tech Pvt Ltd, Bengaluru

Related Posts