Networking & Content Delivery

Deploying multi-region applications in AWS using AWS Global Accelerator

In this post, we’ll discuss how you can improve customer performance and increase resiliency for your multi-region applications with AWS Global Accelerator. We will also provide a walkthrough that helps you set up Global Accelerator to handle traffic management and traffic routing for multi-region application endpoints in both Active-Active as well as Active-Standby deployments.

Global Accelerator is an AWS networking service that improves the availability, security, and performance of your global applications. You can deploy your applications in multiple AWS Regions to serve your global customers. Deploying applications in multiple regions improves customer experience by serving the customers from the closest application endpoint, and it increases the resiliency of your application.

Customers deploy multi-region active-active architectures when they need two or more AWS Regions to actively accept user traffic to load-share the traffic. In case of an event affecting your application endpoints in one Region, the traffic load is automatically distributed among available application endpoints in other Regions. In a multi-region active-standby architecture, user traffic is served by an AWS Region, designated as active Region, and all of the user traffic is handled through this active Region. The standby Region is only used in situations where the active region is unavailable. Global Accelerator helps deploy multi-region applications by providing static Anycast IP addresses that act as a fixed entry point for your application endpoints for single or multiple regions. These Anycast IP addresses are advertised from AWS edge locations. User traffic is carried from the edge locations to the closest regional application endpoint over the AWS Global network, thereby reducing the impact of internet weather on user traffic and improving customer experience. Global Accelerator continually monitors the health of application endpoints and routes the traffic to the optimal endpoint based on health, client location, and configured policies. The automatic route optimizations in Global Accelerator help keep your packet loss, jitter and latency consistently low. Global Accelerator also continuously monitors the health of endpoints by using TCP, HTTP, and HTTPS health checks. In of the event of health check failures, Global Accelerator automatically reroutes end-user traffic to healthy endpoints. Furthermore, you can configure load sharing between application endpoints by configuring traffic dial and endpoint weights. This lets us deploy and run applications in both the Active-Active as well as Active-Standby manner. We can easily modify the configuration of Global Accelerator to switch between the modes.

This post provides a detailed walkthrough of how customers can use Global Accelerator to handle traffic management and traffic routing for multi-region application endpoints in both Active-Active as well as Active-Standby deployments. We recommend that readers see the “Traffic management with AWS Global Accelerator” post to get an understanding of basic concepts and terms associated with Global Accelerator traffic management, as well as how you can use them to make sure of an improved customer experience and resiliency for your applications.

Let’s discuss some scenarios to understand how traffic dials and endpoint weights impact the traffic routing and forwarding in Global Accelerator.

Scenario walkthrough

In this section, we’ll illustrate different scenarios using two tables. The table defined as part of each scenario depicts the number of user requests considered to explain the traffic distribution, Global Accelerator configuration parameters, and the resultant traffic distribution between application endpoints spread across multiple AWS Regions.

Figure 1: Architecture for Scenarios

Figure 1: Architecture for Scenarios 1 and 2.

For reference, the figure above represents the architecture used for Scenarios 1 and 2. In these two scenarios, we’ll consider an application deployed in two AWS Regions. Each AWS Region uses four Amazon Elastic Compute Cloud (Amazon EC2) instances that are deployed across two availability zones. We’ll consider different combinations of traffic dial and endpoint weights in each scenario to illustrate the traffic distribution.

Scenario 1A : Consider 200 user requests originating from the US region. First, the request will arrive at the nearest edge location in US region. As per the configured traffic dial values, all of the requests will be forwarded to the endpoint group in the US-West-1 region. Assuming that all of the EC2 instances are healthy, each EC2 instance in US-West-1 Region will receive 50 requests.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Shaping Scenario

Scenario 1B : Consider 200 user requests originating from US and 100 requests from Europe. First, the traffic will arrive at the closest edge locations in the respective geographies. As per the traffic dial values specified in the following table, the 200 requests originating from US will be forwarded to the endpoint group in US-West-1 Region, and the 100 requests originating from Europe will be forwarded to the endpoint group in EU-West-1 Region. Assuming that all of the endpoints are healthy, the requests will be evenly distributed inside of the respective endpoint group.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 1C : This scenario is similar to 1B, but it has a different number of requests and traffic dial percentages to illustrate how traffic will be distributed across these endpoint groups and endpoints.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 1D : This scenario is similar to 1B, but it has a different number of requests and traffic dial percentages to illustrate how traffic will be distributed across these endpoint groups and endpoints.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

User Traffic Handling during Failover Scenarios

Global Accelerator routes user traffic based on healthy endpoints. In case of the unavailability of healthy endpoints in an endpoint group that has a weight greater than zero, Global Accelerator tries to failover to a healthy endpoint with a weight greater than zero in another endpoint group. If Global Accelerator doesn’t find a healthy endpoint with a weight greater than zero after trying all of the additional endpoint groups, then it routes traffic to a random endpoint in the endpoint group that is closest to the client.

In the following section, we’ll illustrate how user traffic shifts during failover scenarios 2A, 2B, and 2C, with each having different traffic dial percentages and number of healthy endpoints. We’ll use these scenarios to explain how traffic is distributed across these endpoint groups and endpoints.

Scenario 2A : This scenario illustrates a case when one of the endpoints in the US region is unhealthy and unavailable.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 2B : This scenario illustrates a case where one endpoint in two different regions (us-west-1 in US and eu-west-1 in Europe) are unhealthy and unavailable.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 2C : This scenario illustrates a case when all of the endpoints in one region (us-west-1) and one endpoint in the second region (eu-west-1) are unhealthy and unavailable.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 2D : This scenario illustrates a case when all of the endpoints in one region (us-west-1) are unhealthy and unavailable, and traffic gets distributed to EU region (eu-west-1) despite the traffic dial percentage of zero.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 3:

In this scenario, we’ll consider an application deployed in three AWS Regions located in US, Europe and Asia. Each AWS Region uses two EC2 instances that are deployed across two availability zones. We’ll consider different combinations of traffic dial and endpoint weights to elaborate each scenario.

Scenario 3A : This scenario represents the endpoint group traffic dial configuration for the different regions with all of the endpoints being healthy.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 3B : This scenario represents the endpoint group traffic dial configuration for the different regions and the resulting traffic distribution when all of the endpoints in the US region (us-west-1) are unhealthy and unavailable, but the endpoints in Europe (eu-west-1) and Asia (ap-west-1) are healthy.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Scenario 3C : This scenario represents the endpoint group traffic dial configuration for the different regions and the resulting traffic distribution when all of the endpoints in the US and Europe regions (us-west-1, ap-west-1) are unhealthy and unavailable, but the endpoints in Asia (ap-west-1) are healthy.

Traffic Distribution Scenario

Traffic distribution at endpoint group and endpoint:

Traffic Distribution Scenario

Conclusion

Global Accelerator improves the availability, security, and performance of customer applications for local or global users. Global Accelerator intelligently routes users’ traffic to application endpoint on AWS that will give the most consistent performance. Global Accelerator uses the AWS global network to optimize the path from users to applications.

In this post, we introduced you to the underlying architectural concepts of Global Accelerator and illustrated how it routes user traffic to a healthy application endpoint. Furthermore, we demonstrated how it shifts user traffic in different failover scenarios based on endpoint health and endpoint configurations. You can use these constructs of endpoint group, endpoint, and traffic dial and weight in Global Accelerator to maximize end-user performance and availability when deploying multi-region applications.

To learn more, check out AWS Global Accelerator documentation and other AWS Global Accelerator blogs.

About the authors

Amit-K.png

Amit Kumar

Amit Kumar is a Senior Partner Solutions Architect with Amazon Web Services. He works with the customers to provide guidance on enterprise cloud adoption, migration, and strategy.

Vikas.png

Vikas Purohit

Vikas Purohit is Partner Solutions Architect with AWS. He is tech enthusiast and specializes in networking and security. He is passionate about migrating customers to AWS in a secure and scalable manner.