AWS ELB (Elastic Load Balancing) Introduction
What is load balancing?
Load balancing is a technique used to distribute incoming network traffic across multiple server instances to ensure that no single server is overwhelmed.
A real-world analogy: Imagine you are a worker in a team of four, but you end up doing most of the work while the others are idle. This situation can make you feel overwhelmed, and over time, your performance declines as you become exhausted. The overall team performance suffers. The same concept applies to servers. We must distribute the load evenly across all workers to ensure optimal team performance.
Load balancing helps improve the performance, availability, and fault tolerance of the applications by preventing an individual server from being overloaded.
ELB - Elastic Load Balancer
ELB is the service that helps us automatically distribute incoming network traffic across multiple targets, such as EC2 instances...
Why use ELB?
Health checks
Health checks are crucial for load balancers. Before routing any traffic to our instances, the load balancers must verify whether the instance is healthy. If the instance response to the health check is not 200 (OK), it is considered not healthy, and the traffic is not routed to it
领英推荐
?Type of load balancer on AWS
There are 4 types of load balancer on AWS
Classic load balancer (v1 - old generation): compatible with HTTP, HTTPS, TCP, SSL (secure TCP). However, this type of load balancer is deprecated.
Application Load Balancer (v2 - new generation): compatible with HTTP, HTTPS, WebSocket.
Network Load Balancer (v2 - new generation): compatible with TCP, TLS, UDP.
Gateway Load Balancer: this type of load balancer operates at Network layer - IP Protocol.
It is highly recommended to use the newer generation of load balancers as they provide more features.
Some load balancers can be set up as internal (private) or external (public to the internet) ELBs.
Load balancer security groups
To enhance the security mechanism, the application should allow traffic only from the load balancer. We link the security group from the EC2 instance to the security group of the load balancer, we can ensure that the EC2 instance is only allowing the traffic that originates from the load balancer.
?Backend Java Developer @ FPT Software | Database Developer | AWS Cloud Engineer
6 个月Thanks for sharing!