Elastic Load Balancing Essential2009年〜
A service that automatically distributes traffic across multiple servers for high availability and fault tolerance
What It Does
Elastic Load Balancing (ELB) automatically distributes incoming traffic (requests) across multiple targets such as EC2 instances and containers. It prevents load from concentrating on a single server, and if one server fails, others take over processing - improving application availability and fault tolerance. It scales automatically based on traffic volume.
Use Cases
It is used for web application load balancing, traffic control between microservices, centralized SSL/TLS termination, blue/green deployments, and auto-scaling configurations combined with Auto Scaling - serving as the foundation for multi-server systems.
Everyday Analogy
Think of it like a restaurant host. When customers (requests) arrive, the host (load balancer) seats them at available tables (servers). They distribute guests evenly so no single table gets overwhelmed, and if a table becomes unavailable, they continue seating guests at other tables.
What Is Elastic Load Balancing?
Elastic Load Balancing is a fully managed load balancing service from AWS. A load balancer is a device that distributes client requests across multiple backend servers. ELB scales automatically based on traffic volume, handling sudden traffic spikes. Its health check feature automatically detects unhealthy targets and sends traffic only to healthy ones.
Types of Load Balancers
ELB comes in three types. Application Load Balancer (ALB) is optimized for HTTP/HTTPS traffic and supports routing based on URL paths and hostnames. It is the most commonly used for web applications. Network Load Balancer (NLB) handles TCP/UDP traffic with ultra-low latency and the ability to process millions of requests per second. Gateway Load Balancer (GWLB) is used for integration with third-party network appliances.
Integration with Auto Scaling
Combining ELB with Auto Scaling creates a truly elastic system. Auto Scaling automatically adjusts the number of EC2 instances based on traffic, and ELB automatically distributes traffic to newly added instances. This combination provides sufficient servers during peak times and reduces servers during quiet periods to cut costs. For practical tips on Auto Scaling integration, related books (Amazon) are also helpful.
Getting Started
To get started, click 'Create load balancer' in the Load Balancers section of the EC2 console. Select the type (ALB, NLB, or GWLB), configure listeners (incoming ports) and target groups (routing destinations). Register EC2 instances in the target group, and you can access your application via the load balancer's DNS name.
Things to Watch Out For
- ALB and NLB have different pricing models, so choose the right type for your use case
- Improperly configured health checks can cause healthy instances to be marked as unhealthy, preventing traffic from reaching them
- For HTTPS, you can obtain free SSL/TLS certificates from AWS Certificate Manager (ACM) and configure them on the load balancer