Search code examples
amazon-web-servicesamazon-route53

Will route53 choose the closest region to serve the request?


I am planning to deploy my api gateway to multiple regions in AWS. I implement a health endpoint in the gateway in each region and configure them in route53 healthy check. So route53 will forward the request to the healthy regions if one region fails on healthy check.

My question is in case of all regions are healthy, will route53 route traffic to the closest region? For example, if there are 2 regions configured in route53, ap-southeast-1 and ap-southeast-2, can route53 route the traffic to ap-southeast-2 if the request is from Sydney since it is closer? If yes, how does route53 decide which one is closer?


Solution

  • There are three routing policies in R53 that you may consider:

    • Geolocation routing policy – Use when you want to route traffic based on the location of your users.

    • Geoproximity routing policy – Use when you want to route traffic based on the location of your resources and, optionally, shift traffic from resources in one location to resources in another.

    • Latency routing policy – Use when you have resources in multiple AWS Regions and you want to route traffic to the region that provides the best latency.

    how does route53 decide which one is closer?

    • Geolocation is based the location that DNS queries originate from.

    • Geoproximity routing lets Amazon Route 53 route traffic to your resources based on the geographic location of your users and your resources.

    • Latency-based routing is based on latency measurements performed over a period of time.

    For all these, AWS can also use EDNS0 edns-client-subnet extension.