Lesson 2 of 3 Amazon Route 53

Routing Traffic with Route 53 Policies and Health Checks

This lesson explains how Route 53 routing policies make DNS answers depend on health, location, latency or weights, providing global load balancing and failover.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose a routing policy for a requirement.
  • Explain how health checks drive failover.
  • Explain why DNS failover is slower than Global Accelerator.

Routing policies

A routing policy decides how Route 53 answers when a name has more than one possible value. Simple routing returns one record, which may hold several values in random order, and does not use health checks. Weighted routing splits answers by percentage, which suits canary releases and A/B tests between stacks. Latency routing returns the Region with the lowest latency for the user, for applications deployed in several Regions. Failover routing returns the primary record until its health check fails and then the secondary, for active-passive disaster recovery.

Geolocation routing chooses by the user's continent, country or US state, which suits localised content and data residency rules; a default record must handle users from locations that match no rule. Geoproximity routing chooses by distance, with a bias that enlarges or shrinks the area each Region serves, to shift traffic between areas. Multivalue answer routing returns up to eight healthy records for simple client-side load balancing, and IP-based routing chooses by the client's address range, for example to send a known ISP's users to a particular endpoint. The following table summarises the policies.

PolicyBehaviourUse for
SimpleOne record, possibly several values in random order; no health checksSingle resources
WeightedSplit by percentageCanary releases, A/B tests
LatencyLowest-latency RegionGlobal performance
FailoverPrimary until its health check failsActive-passive DR
GeolocationBy continent, country or US state; needs a default recordLocalisation, compliance
GeoproximityBy distance, with a bias (Traffic Flow)Shifting traffic between areas
Multivalue answerUp to eight healthy recordsSimple client-side load balancing
IP-basedBy client CIDRRouting known networks

Policies nest, e.g. latency per Region pointing to weighted or failover records within it; Traffic Flow builds these trees visually.

Match the pairs

Routing policies

Exam skills 3.4.1 · 2.2.2

Match each requirement with the Route 53 routing policy that meets it.

Log in to try this activity Interactive activities are free with an account.

Health checks

Route 53 health checks decide which endpoints receive traffic in failover and other routing policies. A health check monitors an endpoint over HTTP, HTTPS or TCP from several locations around the world, optionally checking that the response contains a given string, and marks the endpoint unhealthy when enough checkers see failures.

Calculated health checks combine other checks, for example treating an application as healthy only if at least two of its three components are healthy. Because health checkers run on the internet, they cannot reach private resources directly; a health check can instead follow the state of a CloudWatch alarm, which can monitor anything inside a VPC.

The following diagram shows a failover routing policy driven by a health check.

Failover routing with health checks. Route 53 health checkers around the world probe the primary endpoint over HTTP, HTTPS or TCP. While it is healthy, Route 53 answers with the primary record; when enough checkers see failures, it answers with the secondary. A private resource that checkers cannot reach is monitored through a CloudWatch alarm that a health check follows.
The Regions are illustrative. Clients that cached the primary answer keep using it until the record's TTL expires.
Scenario questions

Health checks

Exam skills 2.2.3 · 2.2.2

Choose the health check design for each requirement.

Log in to try this activity Interactive activities are free with an account.

Failover speed

DNS failover depends on check interval, failure threshold and client caching for the TTL, so it typically takes a minute or more. For seconds, use Global Accelerator, where clients keep the same IPs.

Worked example

A routing policy for each requirement

Each Route 53 routing policy meets a different requirement. The following table identifies the appropriate policy for several requirements.

RequirementRouting policy
Send users to the Region with the lowest latencyLatency
Fail over to a static maintenance page in S3 if the main site is downFailover with a health check
Send 10% of users to a new versionWeighted
Users in Germany must reach the Frankfurt deployment for legal reasonsGeolocation
Return several healthy IPs so clients can chooseMultivalue answer
Shift more users towards a new Region gradually by geographyGeoproximity with a bias

Health checks can be attached to most policies, so unhealthy endpoints stop being returned. For private resources that Route 53's checkers cannot reach, a health check based on a CloudWatch alarm is used instead.

Check yourself

Which routing policy sends users in Germany to a German endpoint because of data residency rules?

Show answer

Geolocation routing, which chooses the answer by the user's location. Latency routing would send users to the fastest Region, which may be in another country.

Exam Tips

Remember for the exam

  • For active-passive disaster recovery across Regions, use failover routing with health checks.
  • For the lowest latency for global users, use latency-based routing.
  • When users in a country must reach a particular endpoint, use geolocation routing.
  • To send 10% of traffic to a new version, use weighted routing.
  • DNS-based failover is limited by TTL caching; Global Accelerator fails over faster.
  • For a health check on a private resource, base it on a CloudWatch alarm.