SAP-C02 Practice Question 30: Strangler Fig Traffic Shifting
AWS Certified Solutions Architect – Professional (SAP-C02) · Test 3 · question 10 of 10
A logistics company is breaking a monolithic Java application, running on Amazon EC2 behind an Application Load Balancer, into containerized services on Amazon ECS. The plan is to extract one URL path at a time, /pricing first, and to let the monolith keep serving everything else.
For each extracted path the team must be able to send a small share of live traffic to the new service, raise the share gradually over several days while watching error rates, and pull the share back to zero within seconds if something breaks. Clients are third-party partner systems whose configuration the company cannot change, and several of them hold long-lived HTTP connections. The company wants to add as little new infrastructure as possible.
Which approach should the architect use?
Show answer and explanation
Answer:
This is the strangler fig pattern implemented with the load balancer the company already owns. An Application Load Balancer listener rule can match on path-pattern and take a forward action that lists multiple target groups, each with a weight from 0 to 999; requests matching the rule are distributed according to those weights. Setting the new service's weight to a small value, raising it over days, and dropping it back to 0 are all single API calls that take effect immediately, with no DNS involved and nothing to change on the partner side. Because some partners hold long-lived connections and the monolith uses sticky sessions, the rule should also enable target group stickiness, which issues an AWSALBTG cookie so a client stays with the target group it was first routed to.
Option A moves the control point to DNS. Weighted Route 53 records are subject to record TTLs and to resolver and client-side caching, and partner systems holding long-lived connections will not re-resolve at all, so "pull it back within seconds" is exactly what DNS cannot promise. It also means running and paying for a second load balancer.
Option C adds a whole new front door for partners to be re-pointed at, which the stem rules out, and API Gateway canary settings shift a percentage of traffic for a stage rather than for one path alongside an unchanged monolith.
Option D couples the traffic share to capacity: the only way to send 5 percent of requests to the new service is to keep its task count at roughly a twentieth of the fleet, which is not how you size a service for its own load. A single target group also applies one health check and one deregistration behaviour to two very different runtimes, and rolling back means scaling tasks to zero rather than flipping a weight.
References: Strangler fig pattern; Action types for listener rules