Skip to content
tezvyn:

Design an automated rollback process when deployment error rates spike

Source: docs.aws.amazon.comMediumHow cards are made

Summary

judgment when automating rollbacks.

Key points

gate on error-rate and latency thresholds; use blue-green deploys to limit blast radius; require human approval for stateful rollbacks.

Watch out for

instant full rollback from one noisy metric.

What's really being asked

This question tests whether you can design a safe automated remediation system rather than just a deployment conveyor belt. Interviewers want to see that you understand the difference between a deployment pipeline and a resilience strategy. They are looking for signal interpretation, blast-radius containment, and stateful versus stateless reasoning. The core theme is operational rigor: automating recovery without automating chaos.

The full answer

A strong answer walks through four layers in order. First, detection logic: use a composite health signal rather than a single metric. Combine HTTP 5xx rate, p99 latency, and a custom business metric such as checkout conversion drop, evaluated over a 2 to 5 minute window to avoid flapping. Second, traffic isolation: implement blue-green deployments or canary releases so only a small percentage of traffic hits the new version initially. If the composite signal breaches a threshold, halt promotion and drain traffic back to the stable fleet. Third, rollback scope: fully automate rollback for stateless microservices, but require a manual approval gate for any change involving database schema migrations, cache invalidation, or cross-region replication, because backward-incompatible data changes can turn a bad deploy into a data-loss incident. Fourth, post-rollback verification: after shifting traffic, confirm that error rates return to baseline and that the previous artifact is still healthy, rather than assuming old code is automatically good.

The mistakes people make

The biggest red flag is proposing an immediate 100 percent rollback triggered by a single alert. This ignores the possibility that the spike is caused by a downstream dependency or an upstream traffic spike, not the new build. Another red flag is forgetting data-layer risk: saying you would automatically roll back a schema migration without a compatibility plan can corrupt production data. A third pitfall is neglecting the warm-pool requirement; if the old version has been scaled down or its containers evicted, the rollback itself becomes a new deployment with its own cold-start failures.

What usually comes next

The interviewer may ask how you would handle a rollback that itself fails, such as when the previous artifact will not start because its database schema is now newer than what it expects. They may also ask how to prevent rollback loops where a bad build deploys, rolls back, and then the next commit triggers the same cycle. A third follow-up is cost: how do you justify running a blue-green fleet at 2x capacity for the sake of safer rollbacks.

A concrete example

In an AWS CodePipeline setup, you can model this with a CodeDeploy blue-green deployment to an ECS service. The pipeline deploys a new task definition, shifts 10 percent of traffic via an Application Load Balancer target group, and runs a CloudWatch alarm on 5xx rate and latency for 3 minutes. If the alarm fires, CodeDeploy automatically reroutes traffic to the original task set and terminates the new tasks. For the database layer, you place a manual approval gate before any schema change step in the pipeline, ensuring the DBA team reviews backward compatibility before the deploy proceeds.

Interview question

Which approach best exemplifies a safe automated rollback strategy when deployment error rates spike?

  • a.Combine HTTP 5xx rate, p99 latency, and business metrics over a multi-minute window; halt promotion in a blue-green deployment; automate rollback only for stateless services while requiring approval for data-layer changes; and verify baseline recovery afterward.Correct
  • b.Use a 30-second canary window and automatic rollback if p99 latency rises, while scaling down the previous fleet immediately after deployment to reduce cost.
  • c.Require manual approval for every rollback, deploy to a single fleet to save cost, and rely on operators to detect spikes via dashboards.
  • d.Instantly revert 100% of traffic when any single error metric breaches its threshold, and automatically revert all infrastructure changes including database schemas.
Why?

Option A correctly applies composite signal detection, blue-green blast-radius containment, and differentiated automation for stateless versus stateful systems. Option D exemplifies the red flag of instant full rollback from one noisy metric, which can misfire on downstream issues and corrupt data by auto-reverting schemas.

Just read this? Test yourself on what you have been reading.

Read the original → docs.aws.amazon.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on ci/cd — each one lists the topics its interview covers.

See open roles