A developer is designing a deployment strategy for a high-traffic web application hosted on Amazon EC2 instances. The company requires a canary deployment strategy where of the production traffic is routed to the new version of the application for validation. The rollout must allow for an immediate rollback to the stable version in the event of an application error, without waiting for client DNS caches to expire.
Which approach should the developer implement to meet these requirements?
- AConfigure Amazon Route 53 with a Weighted routing policy pointing to separate load balancers for the stable and new versions, assigning weights of and respectively.
- BConfigure Amazon Route 53 with a Multivalue Answer routing policy to return the IP addresses of both the stable and new instances, letting client-side routing distribute the traffic.
- Configure an Application Load Balancer (ALB) with a single listener and two target groups (one for the stable version and one for the new version). Set the listener routing rule to distribute traffic with a weight of to the stable target group and to the new target group.Answer
- DConfigure an Application Load Balancer (ALB) with path-based routing rules to direct of the incoming request paths to the target group of the new version.
Answer
Configure an Application Load Balancer (ALB) with a single listener and two target groups (one for the stable version and one for the new version). Set the listener routing rule to distribute traffic with a weight of to the stable target group and to the new target group.
Configuring an Application Load Balancer (ALB) with weighted target groups shifts traffic at the application layer (HTTP/HTTPS). The client resolves a single DNS name for the load balancer, which then determines how to route requests. When a rollback is required, changing the listener rule weight immediately routes all traffic to the stable target group. This occurs instantly at the ALB level, bypassing client-side DNS caching and TTL limitations.
Step-by-Step Solution
Key Concept
Application Load Balancer weighted target groups shift traffic at the HTTP layer, bypassing DNS caching limitations during canary deployments.