Weighted routing policy

5 minutes 5 Questions

Weighted routing policy is a Route 53 routing mechanism that allows you to distribute traffic across multiple resources in proportions that you specify. This gives you granular control over how DNS queries are resolved and traffic is distributed among your endpoints. With weighted routing, you assign each record a relative weight between 0 and 255. Route 53 then calculates the probability of returning each record based on its weight divided by the total weight of all records. For example, if you have three records with weights of 10, 20, and 70, Route 53 responds to DNS queries with the first record 10% of the time, the second 20%, and the third 70%. Common use cases for weighted routing include: 1. **Load Balancing**: Distribute traffic across multiple resources like EC2 instances or Elastic Load Balancers based on their capacity. 2. **Blue-Green Deployments**: Gradually shift traffic from an old environment to a new one by adjusting weights over time. 3. **A/B Testing**: Send a small percentage of traffic to a new application version while the majority continues using the stable version. 4. **Canary Releases**: Route a small portion of users to test new features before full deployment. To configure weighted routing, create multiple records with the same name and type, assign each a unique Set ID, and specify the desired weight. Setting a weight to 0 stops traffic to that resource, which is useful for maintenance. Weighted routing can be combined with health checks to ensure traffic only routes to healthy endpoints. If a resource becomes unhealthy, Route 53 excludes it from responses and redistributes traffic among remaining healthy resources based on their relative weights. This routing policy provides flexibility for traffic management scenarios where you need precise control over resource utilization and gradual traffic migration between environments.

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
Test mode:
More Weighted routing policy questions
19 questions (total)