Weighted Routing Policy - Complete Guide for AWS SysOps Administrator Associate
What is Weighted Routing Policy?
Weighted routing policy is a Route 53 routing mechanism that allows you to distribute traffic across multiple resources in proportions that you specify. Each resource is assigned a numerical weight, and Route 53 routes traffic based on the ratio of each weight to the total sum of all weights.
Why is Weighted Routing Policy Important?
• Blue/Green Deployments: Gradually shift traffic from an old version to a new version of your application
• A/B Testing: Send a small percentage of traffic to test new features while the majority goes to the stable version
• Load Distribution: Distribute traffic across multiple resources based on their capacity
• Gradual Migration: Slowly migrate users from one environment to another with minimal risk
• Cost Optimization: Route more traffic to cost-effective resources while maintaining some capacity in premium resources
How Weighted Routing Works
1. You create multiple records with the same name and type
2. Each record is assigned a weight value (0-255)
3. Route 53 calculates the probability of selecting each record using: (weight of record) / (sum of all weights)
4. DNS responses are returned based on these calculated probabilities
Example Calculation:
• Record A: Weight 70
• Record B: Weight 20
• Record C: Weight 10
• Total: 100
• Traffic distribution: A gets 70%, B gets 20%, C gets 10%
Key Configuration Elements
• Weight: A value between 0 and 255. Setting weight to 0 stops traffic to that resource
• Set ID: A unique identifier that distinguishes records with the same name and type
• Record Type: Can be A, AAAA, CNAME, or other supported types
• TTL: Time to live determines how long DNS resolvers cache the response
Special Behaviors
• If all weights are 0, traffic is distributed equally among all records
• Setting one record to weight 0 effectively removes it from rotation
• Weights do not need to sum to 100 - Route 53 calculates ratios automatically
• Can be combined with health checks to route traffic only to healthy resources
Use Cases in Detail
Canary Deployments: Start with 5% traffic to new version, gradually increase to 100% as confidence grows
Multi-Region Load Balancing: Distribute traffic across regions based on capacity or cost considerations
Disaster Recovery Testing: Route small amounts of production traffic to DR site to validate readiness
Exam Tips: Answering Questions on Weighted Routing Policy•
Recognize the scenario: Questions mentioning percentage-based traffic distribution, gradual migration, or A/B testing typically point to weighted routing
•
Differentiate from other policies:- Failover = active/passive scenarios with health-based switching
- Latency = routing based on lowest network latency
- Geolocation = routing based on user location
- Weighted = explicit percentage-based distribution
•
Remember the math: Traffic percentage = (individual weight) / (sum of all weights) × 100
•
Health check integration: When a weighted record fails health checks, Route 53 removes it from consideration and recalculates ratios among remaining healthy records
•
Weight of 0: Understand that setting weight to 0 stops traffic to that endpoint - useful for maintenance
•
Blue/Green keywords: When you see terms like gradual rollout, canary deployment, or traffic shifting between versions, think weighted routing
•
Not for geographic requirements: If the question requires routing based on user location, weighted routing is incorrect - choose geolocation or geoproximity instead
•
Combination scenarios: Weighted routing can be combined with health checks for robust traffic management - this is a common exam topic