Skip to main content

Command Palette

Search for a command to run...

Part 4: Latency-Based Routing Policy

Updated
3 min read
Part 4: Latency-Based Routing Policy

Introduction

There's one question that matters most when building globally distributed applications. The question is, how do you give users the fastest possible response without any lag?
Latency-based routing policy is meant specifically for this use-case. Unlike the geolocation routing policy which focuses on where the users are, latency-based routing policy focuses on which region provides the best performance or least latency.

What is Latency-Based Routing?
Latency-based routing directs users to the AWS region that provides the lowest network latency.

Route 53 determines the route with the least latency and forwards your traffic to the server that's highly performant.

How It Actually Works

Latency is calculated based on:

  • AWS network measurements

  • Historical performance data between regions

  • DNS resolver location (not always exact user location)

It is important to note that AWS uses their own internal latency maps and not pinging your servers.

Prerequisites

  • Hosted zone in Route 53

  • At least 2 resources in different AWS regions

  • Public endpoints (IP or load balancer DNS)

8. Step-by-Step Implementation

Step 1: Create First Record (Region 1)

  • Record name: latency

  • Type: A (or Alias)

  • Value: Endpoint in Region A (North Virginia Server IP)

  • Routing policy: Latency

  • Region: US-East (North Virginia) (the Region field is metadata that tells Route 53 the region where the endpoint is physically located)

  • Record ID: North Virginia Server

Step 2: Create Second Record (Region 2)

Same name: latency

Value: Endpoint in Region B (Frankfurt Server IP)

Routing policy: Latency

Region: Europe (Frankfurt)

Record ID: Frankfurt Server

Step 3: Create Records

Route 53 will now automatically:

  • evaluate latency

  • route users accordingly

Testing Latency Routing

Testing requires simulating different locations using a proxy or VPN.

I am using a proxy to connect from a different region in Germany to test out where my traffic will be directed.

I am connected to the Frankfurt server by default since Route 53 maintains internal latency maps between the user DNS resolvers and also AWS regions. It figures out which region (among the ones configured) has the lowest latency to this user

Conclusion

Latency-based routing is one of the most powerful features in Route 53.

It removes the need for manual decision-making and ensures users always connect to the best-performing region available.

For global applications, this can significantly improve the user experience.

From this blogpost, we've seen that latency routing helps you deliver the fastest experience automatically.

But what if you want to:

  • control traffic distribution manually

  • or return multiple healthy endpoints

  • In the next post, we’ll explore Multi-Value Routing Policy.