Routing Policies: Simple, Weighted, and Latency
Use simple routing for single resources, weighted routing for A/B traffic splits, and latency routing to serve users from the closest region.
Routing Policies: Simple, Weighted, and Latency is a free AWS Solutions Architect lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Overview of Route 53 Routing Policies
Route 53 routing policies determine how DNS queries are answered when multiple resource record sets share the same DNS name. The policy tells Route 53 which IP or DNS name to return and under what conditions. Choosing the right routing policy is one of the most frequently tested topics on the SAA-C03 exam.
Available routing policies: Simple, Weighted, Latency-based, Failover, Geolocation, Geoproximity, and Multivalue Answer. Each serves a different use case. Most can be combined with health checks for automatic failover.
Simple Routing Policy
Simple routing maps a DNS name to one or more IP addresses (for A records) or another hostname (for CNAME/ALIAS). When a single value is configured, Route 53 always returns that value. When multiple values are configured, Route 53 returns all values in a random order, and the client picks one.
Simple routing is the default policy and is best for single-resource setups where you don't need health checks, traffic splitting, or geographic differentiation. It does not support health checks—if the resource is unhealthy, Route 53 still returns its address.
# Create a simple routing record
aws route53 change-resource-record-sets \
--hosted-zone-id Z1234567890 \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "A",
"TTL": 60,
"ResourceRecords": [
{"Value": "10.0.0.1"},
{"Value": "10.0.0.2"}
]
}
}]
}'Weighted Routing Policy
Weighted routing distributes DNS queries across multiple resources according to weights you assign. Each record is given a numeric weight between 0 and 255. Route 53 returns each record in proportion to its weight divided by the sum of all weights.
Example: three records with weights 70, 20, and 10 receive approximately 70%, 20%, and 10% of traffic respectively. Weight 0 means the record is excluded from routing but not deleted—useful to stop traffic temporarily without removing the record. Weighted routing is typically used for A/B testing, canary deployments, and blue-green cutover.
# Create two weighted records: 90% to v1, 10% to v2
# Record 1 (v1)
aws route53 change-resource-record-sets \
--hosted-zone-id Z1234567890 \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "app.example.com",
"Type": "A",
"SetIdentifier": "v1",
"Weight": 90,
"TTL": 60,
"ResourceRecords": [{"Value": "1.2.3.4"}]
}
}]
}'Weighted Routing Use Cases
Weighted routing shines in deployment and testing scenarios:
- Canary release: send 5% of traffic to a new version (weight 5) and 95% to the stable version (weight 95); gradually shift weights as confidence grows
- Blue-green deployment: start at 100/0 (all green), slowly shift to 50/50, then 0/100 (all blue), then delete the green record
- Load testing: send a small fraction of production traffic to a test environment to validate performance under real load
Weighted routing works with health checks. If a weighted record's health check fails, Route 53 stops including it in responses and redistributes its weight among healthy records.
Latency-Based Routing Policy
Latency-based routing directs each DNS query to the AWS Region that provides the lowest network latency for the end user. Route 53 measures latency between global DNS resolvers and AWS Regions, and routes queries to the Region with the best measured latency.
You create one record per Region where you have resources, each with type LATENCY and specifying the Region. Route 53 selects the lowest-latency option for each query without comparing actual resources—it uses AWS latency measurements, not real-time measurements from the user's location.
# Create latency records for us-east-1 and eu-west-1
aws route53 change-resource-record-sets \
--hosted-zone-id Z1234567890 \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "api.example.com",
"Type": "A",
"SetIdentifier": "us-east-1",
"Region": "us-east-1",
"TTL": 60,
"ResourceRecords": [{"Value": "54.100.1.1"}]
}
}]
}'Latency Routing vs Geolocation Routing
Latency and Geolocation routing are often confused on the exam:
- Latency routing: routes based on network performance to minimise round-trip time—a user in Japan may be routed to us-west-2 if it has lower latency than ap-northeast-1 at that moment
- Geolocation routing: routes based on geographic origin of the DNS query—a user in Japan is always routed to the Japan record regardless of latency
Use latency routing for performance optimisation; use geolocation routing for content personalisation, regulatory compliance, or language-specific content.
Multivalue Answer Routing
Multivalue Answer routing returns up to 8 healthy records in response to each DNS query, allowing the client to pick one randomly. Unlike Simple routing (which can return unhealthy IPs), Multivalue routing integrates with health checks to only return the IP addresses of healthy resources.
Multivalue Answer is not a substitute for a load balancer—DNS load balancing is less sophisticated and caches records at the client level. However, it provides a simple, cost-effective way to distribute traffic and improve resilience when you have multiple equally capable endpoints.
Routing Policies and Health Checks
Most routing policies (all except Simple) can be associated with health checks. When a health check fails, Route 53 stops returning that record in DNS responses. For Weighted routing, the excluded record's traffic redistributes to healthy weighted records. For Latency routing, the next lowest-latency healthy Region is used.
Health checks are evaluated independently of routing policies and are configurable for HTTP, HTTPS, and TCP endpoints. Calculated health checks combine the results of multiple health checks (AND/OR logic) for composite health assessment.
# Associate a health check with a weighted record
aws route53 change-resource-record-sets \
--hosted-zone-id Z1234567890 \
--change-batch '{
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "app.example.com",
"Type": "A",
"SetIdentifier": "primary-us",
"Weight": 100,
"TTL": 60,
"ResourceRecords": [{"Value": "54.100.1.1"}],
"HealthCheckId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}]
}'Choosing the Right Policy: Exam Tips
Quick exam decision guide for routing policies:
- 'A/B test', 'canary', 'blue-green' → Weighted
- 'lowest latency', 'closest Region', 'best performance' → Latency
- 'single resource', 'simple setup' → Simple
- 'multiple IPs all healthy' → Multivalue Answer
- 'active-passive failover' → Failover
- 'country-specific content', 'regulatory restriction' → Geolocation
- 'route by proximity to resources' → Geoproximity
Weighted Routing for Gradual Migration
Weighted routing is the recommended strategy for gradual traffic cutover during migrations. Typical progression:
- Start: old infrastructure at weight 100, new at weight 0
- Enable new: shift to 95/5 and monitor error rates and latency
- Ramp up: 80/20 → 50/50 → 20/80 → 5/95 over hours or days
- Complete: 0/100; decommission old infrastructure
- Rollback: if issues arise, set new weight to 0 immediately to stop traffic
This pattern minimises risk compared to an immediate cutover and allows quick rollback by adjusting a DNS weight rather than re-deploying.
Combining Latency and Weighted Policies
Route 53 allows you to create sophisticated routing by logically combining policies. For example, you can use latency routing to select the nearest Region and weighted routing within that Region to split traffic between multiple endpoints in it. This is achieved by creating weighted records with a specific SetIdentifier in the same Region, which are then selected by the latency policy.
However, a single record can only have one routing policy. For combined patterns, use one layer of records for latency and a separate set within each Region using weighted records pointing to different ALBs or Elastic IPs.
Quick Check
Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.
Lesson Recap
In this lesson you learned: Simple routing returns one or more values with no health checking, Weighted routing splits traffic by percentage for A/B testing and gradual migrations, and Latency-based routing directs users to the lowest-latency Region for performance optimisation. Most policies integrate with health checks for automatic failover. Next up we explore Failover and Geolocation routing policies.
Frequently asked questions
Is the “Routing Policies: Simple, Weighted, and Latency” lesson free?
Yes — the full text of “Routing Policies: Simple, Weighted, and Latency” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.
What will I learn in “Routing Policies: Simple, Weighted, and Latency”?
Use simple routing for single resources, weighted routing for A/B traffic splits, and latency routing to serve users from the closest region. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Solutions Architect?
No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Routing Policies: Simple, Weighted, and Latency” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Solutions Architect lesson?
Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Hosted Zones and DNS Record Types
- Routing Policies: Simple, Weighted, and Latency
- Failover and Geolocation Routing
- Health Checks and DNS Failover