To enhance response times, a latency-based routing policy can be used. Route 53 will test the response times in the background of all the configured endpoints for a domain name. Route 53 determines the quickest response time between the origin and destination. This is the best destination value that is returned in the DNS response to the requester, as shown in Figure 2.14. Latency-based routing is helpful when servicing traffic from multiple AWS regions by directing user requests to the site with the lowest latency from their location.
After configuring a latency-based routing policy in multiple regions, Route 53 will examine a DNS request and compare its stored latency values from the requester’s location to the configured regions. The region with the lowest latency from the user’s location will be the value returned from the request. The latency values are collected by Route 53 over a period of time and updated as delays on the Internet vary over time. This means a region delivered by a DNS request using a latency policy may be different over time based on traffic conditions on the Internet. The latency measurements are from the requester, and the AWS region, and do not account for any delays inside or beyond the region. If there is additional latency in a container or database, for example, that latency is not calculated by Route 53 latency-based routing policies.
FIGURE 2.11 Route 53 routing policies
FIGURE 2.12 Route 53 simple routing policy
FIGURE 2.13 Route 53 Multivalue response
FIGURE 2.14 Route 53 latency-based routing policy
Route 53 failover routing is used when high availability is desired and you want one site to act as a backup should the primary site fail, as illustrated in Figure 2.15. In normal operations all traffic is directed to the primary site by serving its IP address to queries. Should health checks to the primary fail, then Route 53 will failover to the backup by now sending out the IP address of the standby servers when queried.
Two record sets are defined for the same host. One host is configured as the primary and the other as the backup. So, with failover configured, 100 percent of the traffic will go to the primary until it fails health checks, and then 100 percent of the traffic gets directed to the standby site.
Round-robin routing is a simple method to use Route 53 to load balance using the values returned from queries, as shown in Figure 2.16. Instead of just returning a single value as a simple routing policy does, round-robin will sequentially respond with IP addresses from a pool in a circular fashion. This will equally distribute connection requests across all the hosts in the pool.