Distributing workloads across multiple computing resources is one of the most critical tasks in about any organization. Amazon AWS Elastic Load Balancer is a purpose built service for distributing workloads. This AWS load balancer tutorial blog will take you into the depths of AWS ELB. You will learn how an AWS ELB works, types of load balancers in AWS and more.
In this AWS ELB tutorial, we will cover the following topics in the same order:
- What is AWS Elastic Load Balancer (ELB)?
- How does an AWS ELB Work?
- Types of AWS ELB
- Advantages of AWS ELB
- Conclusion
What is Amazon AWS Elastic Load Balancer?
Elastic Load Balancer (ELB) is a service offered by AWS that is used to distribute network traffic or workload across a pool of servers or cluster of servers.
The role of an ELB is to automatically distribute incoming traffic across the multiple targets within a target group(s), such as EC2 instances, containers, Lambda functions, and IP addresses, in one or more Availability Zones.
How to access a an ELB?
There are multiple ways to do that,
- AWS Management Console – Using the AWS web interface you can create load balancers
- AWS Command Line Interface – AWS provides a command line interface that is compatible with Mac, Windows, and Linux
- AWS SDKs – Language-specific APIs are provided and can be used for any function using the load balancer or other services.
- Query API – This is the most direct way to call load balancers in AWS, but you must only use low-level API actions like sending HTTPs requests.
How does an AWS ELB Work?
The working of the AWS Elastic Load Balancer is very simple. The illustration above sums it all up.
The primary functioning idea of an Elastic Load Balancer is to accept incoming traffic from its customers and then route requests to the targets specified by the client. If the load balancer discovers an unhealthy target, it will stop sending its users there and will proceed to the other healthy targets until that target appears as healthy.
To make an AWS ELB accept incoming traffic you have to configure them by specifying one or more listeners. A listener is a process which will check for connection requests.
Availability zones – If you configure Availability Zones for your elastic load balancer, a load balancer node will be built within that Availability Zone. Enabling several Availability Zones increases the load balancer’s availability while also ensuring that it has at least one registered target. With at least one registered target, the load balancer can direct traffic there. The advantage of having numerous AZs and targets is that the AWS load balancer may divert traffic to other targets if a few fail.
Now, let us have a look at different load balancers in AWS and their functionalities.
Build Scalable Systems with AWS Course
AWS Course
Types of AWS Elastic Load Balancers
There are primarily four types of Elastic Load Balancers:
- Application Load Balancer
- Network Load Balancer
- Gateway Load Balancer
- Classic Load Balancer (Previous-Generation)
1. Application Load Balancer
An Application Load Balancer works at the 7th layer (application layer) of the OSI model which enables it for routing the HTTP/HTTPS traffic. An ALB also supports path-based routing and host-based routing, cross-zone load balancing which we will cover in the later part of the blog.
The Application Load Balancer will listen to the traffic on the protocol of HTTP (Port:80) or HTTPS (Port:443), then it will inspect the received packets, then it will redirect the requests to the best target possible with the highest efficiency.
Host-based Routing using ALB
If you have two websites, intellipaat.com and dashboard.intellipaat.com. Both of the websites are hosted in different EC2 instances and you want to distribute incoming traffic between them to make them highly available.
Normally, we would create two AWS load balancers using CLB, but using ALB it is possible with one and also your money is saved. Instead of paying for 2 ELBs, only pay for a single ELB.
Get 100% Hike!
Master Most in Demand Skills Now!
Path-based Routing using ALB
In this type of routing, the website’s URL path will be hosted on different EC2 instances. For example, consider intellipaat.com and intellipaat.com/tutorial and these URL paths are hosted on different EC2 instances. Now, if you want to route traffic between these two URLs then you can use a path-based routing method. ALB can be used to solve this problem too, you can use traffic routing according to the path feature by using just one ALB.
Cross-Zone Load Balancing
By default ALB nodes distributes traffic to instances in its availability zone only. When it is enabled then it will route the traffic evenly across EC2 instances. If cross-zone load balancing is disabled, the load balancer will only distribute traffic to instances in its Availability Zone.
2. Network Load Balancer
A Network Load Balancer works at the 4th layer (transport layer) of the OSI model which can handle millions of requests per second securely while maintaining ultra-low latencies.
The Network Load Balancer will listen to the traffic on the protocols of TCP (suitable for web-browsing, e-mail, file transfer), UDP (high transfer speeds for video/audio streaming, games), it also supports TLS which offloads encryption and decryption to your load balancer.
Let’s take a basic example: you own an ecommerce website that receives significant traffic every day. One day, after a new product on your website was launched, and due to its limited stock, many clients visited your website; the website’s traffic is quite high, and you require an instant solution to maintain it; AWS Network Load Balancer will assist you in this circumstance!
3. Gateway Load Balancer
The Gateway Load Balancer in AWS is used to create, scale, and manage virtual appliances including firewalls, intrusion detection and prevention systems, and deep packet inspection systems.
It combines a transparent network gateway (a single entry and exit point for all traffic) and distributes traffic while scaling your virtual appliances to meet demand.
It is used in Firewall Management: To deploy stateful firewalls for inspecting and securing network traffic, Intrusion Detection: Use IDS/IPS systems to monitor and block malicious activities, Network Analytics: Route traffic through monitoring solutions for analysis and insights.
4. Classic Load Balancer – Previous Generation
A Classic Load Balancer routes incoming application traffic across many EC2 instances in different AZs. The Classic Load Balancer increases the application’s fault tolerance by detecting sick instances and routing traffic solely to healthy instances. AWS’s Classic Load Balancer is utilized on EC2-classic instances. This is the previous generation’s load balancer, and it does not support host- or path-based routing.
Boost Your Career with AWS DevOps Skills!
AWS DevOps Training
Advantages of AWS ELB
- Highly Available
- It will automatically distribute traffic across multiple targets such as EC2 instances, containers, or IPs in one or more AZs.
- If the ELB detects unhealthy targets then it will re-routes traffic to healthy ones which ensures minimal downtime
- Scalability
- It also Supports automatic scaling to handle varying traffic loads, adapting seamlessly to changes in demand.
- Enhanced Security
- AWS ELB can be integrated with AWS services like AWS Certificate Manager (ACM) for SSL/TLS encryption.
- AWS ELB works with AWS WAF also for application-level protection against common vulnerabilities.
- With the help of security groups we can control inbound and outbound traffic.
- Flexibility
- Application Load Balancer (ALB): For HTTP/HTTPS traffic and advanced routing.
- Network Load Balancer (NLB): For high-performance TCP/UDP traffic with low latency.
- Gateway Load Balancer (GWLB): For traffic distribution to third-party virtual appliances.
- Ease of Management
- Fully managed service that requires minimal maintenance, allowing you to focus on your applications.
- Integrated with AWS services like Auto Scaling, CloudWatch, and Route 53 for monitoring and optimization.
- Robust monitoring and auditing
- Applications and their performance can be monitored and maintained. You can also use CloudWatch metrics and logs to analyze our applications data, traffic, and working.
Check out our AWS Tutorial and start learning!
Conclusion
In this blog we have learned about the role of AWS Elastic Load Balancer is to improve the application’s reliability, performance, and scalability. How it helps to distribute traffic across multiple targets, ensuring high availability and fault tolerance.Also the different types of load balancers i.e. Application, Network, Gateway, and Classic along with their specific use cases. We have also studied ELB’s integration with AWS services for enhanced security, monitoring, and automation, which will make it a vital component for managing workloads in the cloud effectively. Get on board with our AWS cloud migration training and discover how to navigate the complexities of cloud migration.
Our AWS Courses Duration and Fees
Cohort starts on 14th Jan 2025
₹22,743
Cohort starts on 28th Jan 2025
₹22,743
Cohort starts on 14th Jan 2025
₹22,743