Rollback strategy

What it is

A rollback strategy is the pre-planned, repeatable way to return a service to a known-good state after a bad release. It defines how you undo or compensate for a failed deployment — redeploy the previous version, switch traffic back, or toggle a flag — and who triggers it and how fast.

Why it exists

Bad releases happen. The cost isn’t the failure itself but how long it takes to recover. A deliberate rollback plan minimizes mean time to recover (MTTR) and limits user impact, so teams can ship faster without fear — because they know they can always get back to a good state.

Key ideas

  • Deployment pattern drives rollback:
    • Blue/green → flip traffic back to the previous environment (instant).
    • Canary / rings → stop expanding and route the affected subset back to the stable version.
    • Feature flags → disable the flag (kill switch) — often fastest, no redeploy.
    • Forward fix / redeploy → ship a corrective build; fallback when rollback isn’t viable (e.g. incompatible DB schema).
  • Statefulness is the hard part: databases/schema migrations may not be simply reversible — plan for forward-fix or data-compatible migration alongside code rollback.
  • Automate & rehearse: gate-triggered or on-call-triggered rollback should be tested, not improvised at 2am.
  • Pair with deployment gates (post-deployment health checks) to detect the need to roll back early.

How it fits

Rollback is the safety net that makes aggressive continuous delivery viable. Every release strategy must answer: “If this goes wrong, how do we get back to good?” — before shipping.

Exam notes

  • Rollback should be pre-planned and (ideally) automated/tested; match the mechanism to the deployment pattern.
  • Feature flags = fastest rollback (kill switch, no redeploy).
  • Blue/green = instant rollback by switching environments.
  • Watch for stateful/data issues: a code rollback may not undo a schema migration — consider forward-fix.

blue-green-deployment · canary-deployment · feature-flags · deployment-ring · release-strategy

📘 Source: Microsoft Learn — Rollback Strategy