Server Load Balancer is applicable to the following scenarios:
Scenario 1: Distribute traffic load for high-traffic applications
If your application traffic is high, you can use Server Load Balancer to distribute the traffic to multiple ECS instances. Additionally, you can use the session persistence feature to forward session requests from a client to the same backend ECS instance to improve access efficiency.
Scenario 2: Expand service capability for applications
You can extend service capabilities by adding and removing backend ECS instances at any time, depending on your business needs. It is applicable to Web and App applications.
Scenario 3: Eliminate single point of failure (SPOF)
You can add multiple ECS instances to a Server Load Balancer instance. With the health check feature, Server Load Balancer automatically blocks unhealthy ECS instances and distribute requests to healthy ECS instances, eliminating any single point of failure.
Scenario 4: Disaster tolerance in one region (multi-zone disaster tolerance)
To provide more reliable services, multiple zones for Server Load Balancer are deployed in most regions. If a primary zone becomes unavailable, Server Load Balancer rapidly switches to a backup zone to restore its service capabilities within 30 seconds. When the primary zone becomes available, Server Load Balancer automatically switches back to the primary zone.
We recommend that you create a Server Load Balancer instance in a region with multiple zones for disaster tolerance. You can deploy ECS instances as needed. It is a best practice to add at least one ECS instance in each zone, which can achieve load balancing featuring higher availability and lower latency.
As shown in the following figure, ECS instances in different zones are added to the Service Load Balancer instance. When primary zone A works normally, traffic is distributed to ECS instances in the primary zone A, as the blue line shows. When primary zone A becomes unavailable, traffic is distributed to ECS instances in the backup zone, as the black dotted line shows. This avoids service interruption because of failure of a single zone, and also reduces latency because you can freely choose zones with lower latency.
If you add all the ECS instances to the primary zone and have no ECS instances in the backup zone. In this situation, when the primary zone is unavailable, Server Load Balancer switches to the backup zone. However, there are no ECS instances to handle the distributed requests in the backup zone. In this case, low latency is achieved at the expense of high availability.
Scenario 5: Cross-region disaster tolerance
You can deploy Server Load Balancer instances in different regions and add ECS instances in different zones of the regions to them respectively. Combined with DNS, you can achieve cross-region disaster tolerance by deploying Server Load Balancer in different regions and using DNS to resolve the domain name to the IP addresses of the Server Load Balancer instances. When a region becomes unavailable, you need to stop domain name resolution for the region so that user access is not affected.