Route 53 weighted routing

Routing policies are the rules and algorithms that route traffic to different endpoints like IP addresses, AWS resources, or other domain names based on various criteria. These routing policies provide flexibility and control over how traffic is distributed to different endpoints, allowing users to optimize the performance, availability, and cost-effectiveness of their applications and services hosted on AWS.

Route 53 offers several routing policies to allow users to implement sophisticated traffic routing strategies tailored to their specific requirements. Here, we will explore the weighted routing policy.

Weighted routing policy

Weighted routing policy enables users to control the distribution of traffic among multiple resources by assigning weights to each resource. This allows traffic splitting based on specified ratios, providing flexibility in testing new deployments or allocating traffic based on resource capabilities. Users can adjust the weights dynamically to gradually shift traffic to new deployments or to scale resources up or down. Weighted routing is ideal for scenarios such as A/B testing, gradual rollouts of new features, or load balancing across resources with varying capacities. Additionally, weighted routing supports health checks, ensuring traffic is not routed to unhealthy endpoints.

Weighted routing with different scenarios

Here’s how we can configure weighted routing for different scenarios:

  • For A/B testing environments, we have two versions of an application or website. Weighted routing facilitates this process by directing a specified percentage of traffic to each version. For example, if we want to direct 70% of the traffic to version A and 30% to version B, we can set a weight of 70 for a.example.com and 30 for b.example.com.

  • For gradual rollouts of new features or updates. Instead of releasing a new feature to all users at once, we can start by directing a small percentage of traffic to the updated version and gradually increase the weight as confidence in the new version grows.

The illustration below shows how weighted routing works in Route 53:

Health checks on endpoints
Health checks on endpoints
1 of 6


In the illustration above, four resources are mapped to a domain, and each resource has a weight associated with it. Here is a brief explanation of the illustration above:

  • Health checks on endpoints: Route 53 initiates a health check on the endpoints in the hosted zone.

  • Update the zone file: Route 53 updates the health status of the endpoints in the zone file. All the resources are healthy, so their health status is “Healthy.”

  • DNS queries: Route 53 resolves DNS queries and responds to requests. These responses are determined by the weights assigned to each endpoint.

  • Traffic distribution: Route 53 distributes the traffic among resources according to their associated weights. In this scenario, 10% of DNS queries are directed to endpoint “192.0.1.3,” while another 10% are directed to endpoint “192.0.1.4”. Endpoints “192.0.1.1” and “192.0.1.2” handle 80% of DNS queries, each responding to 40%.

  • Failed health check: Route 53 performs health checks on the endpoints again, and the endpoint “192.0.1.4” fails the health check. The zone file is updated with the updated health status.

  • Traffic redistribution: Route 53 doesn’t route the traffic to the unhealthy endpoint but redistributes it among other healthy endpoints.

1

Which statement best describes the weighted routing policy in AWS Route 53?

A)

It routes traffic to the nearest endpoint.

B)

It allows us to control traffic distribution among multiple resources by assigning weights.

C)

It routes traffic to a random endpoint.

D)

It only routes traffic to healthy endpoints.

Question 1 of 30 attempted

Conclusion

Routing policies play a crucial role in directing traffic to various endpoints, enhancing the flexibility, performance, and cost-effectiveness of AWS-hosted applications. The weighted routing policy provides a robust solution for managing traffic and optimizing resource utilization in diverse deployment environments with its ability to dynamically adjust traffic distribution and support health checks.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved