Exams / SAP-C03 / Study guide / Deployment strategies with rollback (blue/green, canary, rolling)
Deployment strategies with rollback (blue/green, canary, rolling): SAP-C03 study notes and practice questions
What to know about Deployment strategies with rollback (blue/green, canary, rolling) for the SAP-C03 exam, from the Operational Excellence and Automation domain (20% of the exam guide), then 1 free question to test it. Part of the SAP-C03 study guide.
SAP-C03 asks which deployment strategy meets a requirement such as “no downtime”, “expose the change to 10% of users first” or “roll back in seconds”, and how to make the rollback automatic.
The strategies
Strategy
How it works
Rollback
Cost
All at once
Replace everything together
Redeploy the old version; downtime
Lowest
Rolling
Replace in batches
Redeploy; mixed versions during rollout
Low
Canary
Small share of traffic first, then the rest
Shift traffic back
Low to medium
Linear
Equal increments at fixed intervals
Shift traffic back
Low to medium
Blue/green
New environment beside the old, then switch traffic
Switch back quickly
Highest while both run
CodeDeploy
EC2 and on-premises: in-place with OneAtATime (default), HalfAtATime or AllAtOnce, or blue/green with a new Auto Scaling group behind the load balancer.
Lambda: shifts an alias between versions, for example LambdaCanary10Percent5Minutes or LambdaLinear10PercentEvery1Minute.
ECS: blue/green with two target groups and test listener, such as ECSCanary10Percent5Minutes or ECSLinear10PercentEvery1Minutes.
Automatic rollback on deployment failure or when a CloudWatch alarm fires; lifecycle hooks (for example BeforeAllowTraffic) run validation tests before traffic moves.
Amazon ECS options
Rolling update with the deployment circuit breaker: if tasks fail to reach steady state, ECS stops the deployment and, with rollback turned on, returns to the last working revision. CloudWatch alarm based rollback works alongside it.
Built-in blue/green (and linear and canary) deployments in ECS itself, with a bake time and lifecycle hooks, without a separate CodeDeploy application.
Other services
EC2 Auto Scaling instance refresh replaces instances gradually with a minimum healthy percentage, checkpoints and automatic rollback.
Elastic Beanstalk: rolling, rolling with additional batch, immutable, traffic splitting, or blue/green by swapping environment URLs.
API Gateway canary release on a stage sends a percentage of requests to a new deployment.
ALB weighted target groups shift traffic between blue and green without DNS changes.
AppConfig rolls out feature flags gradually with alarm-based rollback, separate from code.
How to choose
Scenario wording
Choose
“Send 10% of Lambda traffic to the new version, then all after 10 minutes”
CodeDeploy LambdaCanary10Percent10Minutes
“Instant rollback with no redeploy”
Blue/green
“ECS deployment keeps failing health checks and must revert itself”
ECS deployment circuit breaker with rollback
“Roll back when error rate rises during rollout”
CloudWatch alarms attached to the deployment
“Can’t run two full copies of production”
Rolling or canary, not blue/green
“Clients cache DNS for hours”
Shift at the load balancer, not with Route 53 weights
Common traps
DNS-based blue/green when clients ignore TTLs; traffic keeps reaching blue.
Canary with no alarms, so nothing triggers rollback.
In-place all-at-once for a “no downtime” requirement.
Rolling deployments for schema changes that the old version can’t read; make database changes backward compatible first.
Rebuilding the artifact for rollback instead of switching back to the previous version.
A car maker's dealer-portal API runs as an AWS Lambda function behind API Gateway. Releases must reach a small share of traffic first, and the release must roll back automatically if the error rate alarm fires during the first minutes after the change.
The team wants a deployment that shifts traffic in steps with no servers to manage, and it wants the previous version kept so it can be restored quickly.
Which deployment configuration meets these requirements?
Choose one answer.
AA. Replace the function's code in place with the new version at once, and roll back by uploading the previous code package if the error rate rises.
BB. Deploy with CodeDeploy using a Lambda canary configuration that shifts a small share of traffic to the new version first, with a CloudWatch alarm that triggers automatic rollback.
CC. Package the new version as a container image, deploy it to an Auto Scaling group of EC2 instances behind an Application Load Balancer, and move the instances over one at a time by hand.
DD. Create a second API in API Gateway with the new version, and ask dealers to switch to its address when they are ready.
Show the answer and explanation
Answer: B
A. Wrong: An all-at-once in-place change sends the new version to every caller immediately, and the rollback is a manual upload. The option misses the staged traffic shift and the automatic rollback.
B. Right: Correct. CodeDeploy shifts a small share of traffic to the new version first, then the rest after the period if the alarm stays quiet. Lambda versions keep the previous version available, and the alarm triggers the rollback with no servers to manage.
C. Wrong: The option moves the function onto servers the team must manage, and the instance-by-instance move is manual. It does not use the Lambda versions the team wants.
D. Wrong: Asking dealers to switch addresses leaves no staged traffic shift and no automatic rollback. The option moves the burden of the release onto the customers.
Explanation
A CodeDeploy canary on the Lambda version shifts a small share of traffic first and rolls back automatically on a CloudWatch alarm, with the previous version kept and no servers to run. In-place or manual changes, EC2 moves and customer-side switches each miss the staged or automatic element.
Only a small share of dealers reach the new version at first, and the alarm rolls back before everyone is affected.
Want more on Deployment strategies with rollback (blue/green, canary, rolling)? The 5 full-length practice sets have 7 more Deployment strategies with rollback (blue/green, canary, rolling) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →
Study Deployment strategies with rollback (blue/green, canary, rolling)