Blog 7 Sp21

Blog 7

Amazon Web Services | Load Balancing

Alright, let’s imagine you are responsible for the infrastrucutre behind a high traffic website. The website you’re managing will not always have high traffic, and it won’t always have low traffic. With traditional IT infrastructures in place, there’s no way keep up with the fluctuations will be good for the company behind your website. Hardware for that is quite pricy, and so is the labor involved in configuration and maintenance of said hardware. This is where the wonderful AWS Cloud and its resources come into play. With the help of a few tools, you can automate the creation of cloud resources to support your website.

Elastic Load Balancing

Elastic Load Balancing is an AWS tool/service that allows you to distribute incoming service requests/ network traffic, across a plethora of targets. These targets can be AWS EC2 instances, containers, IP addresses, and certain AWS Lambda functions. These targets could be from multiple AWS Avilablity Zones, or a specific Availablity Zone. Elastic Load Balancing automaitcally scales a load blalancer as traffic to your application changes throughout its life cycle.

3 Types of Load Balancers

There are currently 3 types of Elastic Load Balancers:

  1. Application Load Balancer - Reserved for application layer use cases, it routes traffic to targets based on the type of requests being made. The most ideal use cases involve HTTP & HTTPS traffic.
  2. Network Load Balancer - Operates at the network transport level, routing connections to targets, based on the IP protocol data. The most ideal use cases involve the TCP & UDP protocols. It’s able to handle millions of requests per second while maintaining low latency.
  3. Classic Load Balancer - this one provides basic load balancing across multiple EC2 instances, operating at both the Application and Network Layers of the OSI model. It supports the balancing of applications using HTTP, HTTPS, TCP and SSL. This was the earlier iteration, or “classic” of a load balancer. AWS recommends you use either the application or network load balancer types.

How Does It Work Tho ?

awselb.PNG

The Elastic Load Balancer takes incoming traffic from clients and points requests to the specified targets. These targets could be something like an EC2 hosting an application. You’d also need to to establish one or more listeners. The listener is a process that checks for connection requests. It’s configured to with a protocol and portnumber for connections from clients to the load balancer, andfrom the load balancer to the targets.

If configured, the load balancer is able to perform system health checks for all the targets. When an unhealthy target is deteced, it stops sending things to that target. It will resume, after the health check is passed.

Written on April 16, 2021