CLOUD CONCEPT

Latency-Based Routing

Latency-based routing directs clients to an eligible endpoint expected to provide the lowest network delay.

Cloud Concepts Hub →

What is Latency-Based Routing

Latency-based routing selects among multiple application endpoints using measured or estimated network latency rather than geographic distance or fixed traffic percentages. It helps distributed applications reduce connection and response times, but its effectiveness depends on measurement quality, endpoint health, DNS behavior, and the application's data architecture.

Latency-based routing is a traffic-management policy that chooses an endpoint according to expected network delay from the client or a representative network location. It is commonly used for applications deployed in multiple cloud regions, where users can access equivalent instances of the same service. The objective is to improve responsiveness, not necessarily to choose the geographically nearest deployment or distribute traffic evenly.

In a DNS implementation, an authoritative DNS service selects an answer when a recursive resolver queries an application hostname. The decision may use historical network measurements, the resolver's location, or client-network information supplied through EDNS Client Subnet when supported. The client then connects directly to the returned endpoint; the DNS service does not proxy application traffic. This differs from connection-level steering through a global network frontend, which can select a destination without relying on a new DNS answer.

For example, an application might run in eastern North America and western Europe. European users would often receive the European endpoint, but Internet routing and peering can make a more distant region faster for some networks. The routing service generally uses its own measurement model rather than timing a fresh request from every individual client. In Amazon Route 53, latency records identify AWS Regions, and selection uses latency measurements associated with those Regions. This is not a direct measurement of each application's processing time.

Health and latency are separate concerns. A low-latency endpoint might have a failed application, an overloaded database, or insufficient capacity. Configure health checks or supported target-health evaluation so that routing can avoid unhealthy destinations, and understand the provider's behavior when every destination is unhealthy. Application readiness checks should reflect whether an endpoint can actually serve useful requests, not merely whether a TCP port accepts connections.

DNS caching limits how quickly routing changes reach clients. Recursive resolvers and applications can reuse an answer until its cache lifetime expires, and existing connections normally continue using their original destination. Shorter time-to-live values can improve responsiveness to changes but increase DNS query volume and do not guarantee immediate failover. Centralized enterprise resolvers can also make many geographically dispersed users appear to originate from one location, reducing selection accuracy.

Hybrid and multi-account architectures require particular attention to DNS visibility and query paths. Establish which public or private namespace owns the application name, how accounts receive access to private zones, and how on-premises resolvers forward queries. Conditional forwarding and resolver endpoints provide name-resolution connectivity; they do not themselves implement latency-based endpoint selection. Public Internet latency estimates may poorly represent a private path over a VPN or dedicated circuit. Validate the chosen endpoint and actual application latency from each relevant network.

Distinguish latency routing from other exam-tested policies. Geolocation routing selects destinations according to geographic rules, such as country-specific service requirements. Weighted routing assigns configured proportions of DNS responses, useful for gradual releases, but does not inherently select the fastest endpoint. Failover routing prefers a primary destination until health conditions require a secondary. Where supported, hierarchical DNS policies can combine regional latency selection with weighted deployment choices, but each policy layer needs explicit health and fallback behavior.

Finally, faster network access does not guarantee faster transactions. A nearby application that synchronously accesses a distant database can perform worse than a more distant, self-contained deployment. Plan data replication, session handling, consistency, regional capacity, and residency constraints before enabling cross-region selection. Test with both DNS queries and end-to-end application measurements rather than assuming the selected region is always optimal.

Key aspects of Latency-Based Routing

Effective latency-based routing combines a suitable latency model, healthy regional endpoints, predictable DNS behavior, and an application architecture that supports regional execution.

Selection by expected network delay

Endpoints are ranked using measured or estimated latency rather than physical distance alone. Verify what the routing platform measures and whether that model represents the actual client-to-endpoint path.

DNS granularity and caching

DNS-based decisions occur during name resolution and may be shared by many clients behind a recursive resolver. Cached answers and persistent connections prevent routing changes from taking effect immediately.

Health-aware endpoint eligibility

Health checks determine whether an endpoint should participate, while latency determines which eligible endpoint is preferred. Review all-unhealthy behavior and use checks that represent application readiness.

Distinct traffic-management objectives

Latency routing optimizes expected delay; geographic routing enforces location rules, and weighted routing controls response proportions. Combine policies only when the platform supports the required hierarchy and its behavior is understood.

Hybrid DNS path awareness

Enterprise forwarding, shared resolvers, and private connectivity can change how a client's location is represented. Test endpoint selection from on-premises networks and each participating cloud account rather than relying only on public DNS tests.

Application and data readiness

Every selected region must have suitable capacity, application state, and access to required data. Evaluate end-to-end response times because lower network latency can be offset by cross-region database calls or replication constraints.

Cloud services for Latency-Based Routing

Amazon Route 53 and Azure Traffic Manager apply latency-oriented selection at the DNS layer, returning a destination that clients subsequently contact directly. They are typically alternatives for authoritative traffic management rather than services that must be chained. AWS Global Accelerator offers a different approach for supported AWS endpoints: a stable anycast frontend with network-level regional steering. In any design, regional applications and load balancers must expose useful health signals and sufficient capacity. Choose the traffic-management layer according to protocol support, DNS caching tolerance, network requirements, and operational complexity.

Amazon Route 53 image Amazon Route 53

Latency-based DNS records select among configured AWS Regions using Route 53's latency measurements and the query's available location information. Health checks or supported alias target-health evaluation can influence endpoint eligibility; DNS caching still limits how quickly clients observe changes.

Open Amazon Route 53 →
AWS Global Accelerator image AWS Global Accelerator

Global Accelerator provides static anycast IP addresses and directs connections toward healthy regional endpoints using factors including client location, endpoint health, and configured traffic controls. It is a complementary performance-oriented approach rather than a Route 53 latency DNS policy, and it carries traffic over the AWS global network.

Open AWS Global Accelerator →