Lesson 6 of 8 High Availability and Resilient Design Patterns

Steering Global Traffic with Route 53, Global Accelerator and CloudFront

This lesson explains how Route 53, Global Accelerator and CloudFront steer users worldwide to the best healthy endpoint, and how protocol, failover speed and routing logic decide which to use.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose a Route 53 routing policy.
  • Distinguish Global Accelerator from CloudFront.
  • Combine latency and weighted routing.

Route 53 routing policies

Route 53 routing policies decide how a query is answered. Simple routing returns one resource. Weighted routing splits answers by percentage, for canary releases and migrations. Latency routing returns the Region with the lowest latency for the user. Failover routing returns the primary while its health check passes and the secondary otherwise, for active-passive designs.

Geolocation routing answers by the user's continent or country, for compliance or localisation. Geoproximity routing answers by distance, with a bias that enlarges or shrinks the area a Region serves, configured through Traffic Flow. Multivalue answer routing returns up to eight healthy records, and IP-based routing answers by the client's CIDR range. The following table summarises the policies.

PolicyUse for
SimpleOne resource
WeightedSplitting by percentage for canaries and migrations
LatencyThe lowest-latency Region
FailoverActive-passive with health checks
GeolocationBy continent or country, for compliance or localisation
GeoproximityBy distance, with a bias to grow or shrink a Region's area (Traffic Flow)
Multivalue answerUp to eight healthy records
IP-basedBy client CIDR

Alias records and Traffic Flow combine policies into trees, such as latency between Regions and weighted within each, all with health checks. Alias queries to AWS resources are free.

Global Accelerator and CloudFront

Global Accelerator and CloudFront both bring users onto the AWS network at a nearby edge location, but they do different jobs. AWS Global Accelerator provides two static anycast IP addresses. Traffic enters AWS at the nearest edge and travels over the AWS backbone to endpoint groups in each Region: ALBs, NLBs, EC2 instances or Elastic IP addresses. It carries any TCP or UDP traffic, fails over between Regions within seconds with no DNS caching involved, and can shift traffic with traffic dials and weights. It can also preserve client IP addresses.

Amazon CloudFront is a content delivery network for HTTP and HTTPS. It caches content at the edge, accelerates dynamic requests, runs edge functions and integrates with AWS WAF. It fails over between origins with origin groups. The following table summarises the differences.

AWS Global Accelerator
What it isTwo static anycast IPs bringing users onto the AWS network at the nearest edge
ProtocolsTCP and UDP
FailoverSeconds, no DNS caching; traffic dials and weights
ExtrasEndpoint groups per Region (ALB, NLB, EC2, Elastic IP); can preserve client IPs
Amazon CloudFront
What it isA CDN for HTTP and HTTPS
ProtocolsHTTP and HTTPS
FailoverOrigin failover through origin groups
ExtrasEdge caching, dynamic acceleration, edge functions, WAF

Which to choose

The three global traffic services meet different needs, and the requirement in the scenario usually points to one. Global Accelerator is the choice for non-HTTP protocols, for static IP addresses that customers can add to firewall allow lists, and for Regional failover in seconds. CloudFront is the choice for caching content and accelerating HTTP traffic. Route 53 is the choice for routing by geography, latency or weight at the DNS level. They are often combined, such as Route 53 in front of CloudFront distributions. The following table summarises the choice.

NeedChoose
Non-HTTP protocols, static IPs for allow lists, fast Regional failoverGlobal Accelerator
Caching and HTTP accelerationCloudFront
DNS routing by geography, latency or weightRoute 53
Sort into groups

Which global routing service?

Exam skills 1.4.5

Choose the service for each global traffic requirement.

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

Latency routing between Regions, weighted within each

A global API runs in us-east-1 and eu-west-1. Users should reach the nearest healthy Region, and within eu-west-1 a new stack should receive 20% of that Region's traffic. Route 53 builds this as a tree: latency records at the top point to weighted record sets underneath.

api.example.com    latency  us-east-1  -> alias api-use1.example.com   (evaluate target health)
api.example.com    latency  eu-west-1  -> alias api-euw1.example.com   (evaluate target health)

api-euw1.example.com  weighted 80  -> alias ALB stack A (eu-west-1)    health check: /health
api-euw1.example.com  weighted 20  -> alias ALB stack B (eu-west-1)    health check: /health
api-use1.example.com  simple       -> alias ALB (us-east-1)

If both eu-west-1 stacks fail their health checks, the alias for api-euw1 becomes unhealthy, and the latency record for eu-west-1 is no longer returned, so European users are sent to us-east-1. Traffic Flow can manage such trees as versioned policies. If clients need static IP addresses or failover faster than DNS TTLs allow, the same topology is built with Global Accelerator endpoint groups and weights instead.

Check yourself

When does Global Accelerator suit better than Route 53 latency routing?

Show answer

When clients need static IP addresses, failover within seconds without DNS caching, or support for non-HTTP traffic such as UDP.

Exam Tips

Remember for the exam

  • For fast Regional failover without DNS TTL delays, use Global Accelerator.
  • Static IP addresses for customers' allow lists point to Global Accelerator.
  • To serve users in particular countries from particular endpoints, use geolocation routing.
  • To shift traffic towards a Region by geography, with a bias, use geoproximity routing.
  • For gradual migration of traffic by percentage, use weighted routing.
  • UDP gaming traffic with global failover points to Global Accelerator.