AWS ELB (Elastic Load Balancing) Introduction

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?

  • ELB helps to reroute traffic to healthy instances when an instance is dead.
  • Distribute load across multiple EC2 instances or containers.
  • Expose a single access point (DNS) to our application.
  • Can do health checks on our instances.
  • Can provide SSL for our website.
  • Abstract the private traffic from the internet, and separate it from public traffic.
  • Using ELB is more cost-effective than setting up our own load balancer, saving both effort and resources.
  • Provide out of the box integration with many AWS services.

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.


Lê Qu?c D?ng

?Backend Java Developer @ FPT Software | Database Developer | AWS Cloud Engineer

6 个月

Thanks for sharing!

要查看或添加评论,请登录

Huy Nguyen的更多文章

社区洞察

其他会员也浏览了