Skip to content

Rollback

A rollback restores a system to a previous known-good state after a change fails; in deployment, it is the emergency operation of reverting traffic or code to the last version that worked, ideally in under five minutes.

Definition

What it is

Rollback is a promise you make to yourself: when the change fails, you can undo it. It differs from revert (undoing a commit in git, which produces a new commit) and from roll-forward (fixing forward with a new deploy). It is the operational answer to "this deploy broke production".

Rollback exists at multiple layers. At the code layer, it means redeploying the previous artifact. At the traffic layer, it means flipping routing back (blue/green, canary). At the data layer, it means restoring from a backup or replaying a migration reversal. At the DNS layer, it means switching the record back. Each layer has its own rollback speed and its own cost.

Why it matters

A deploy without a rollback is a bet with the users' experience. With rollback, the bet has a floor: if the deploy fails, users feel a few seconds or minutes of degraded service, not an outage. The presence of rollback makes developers willing to deploy more often, which makes deploys smaller, which makes failures rarer. The reliability flywheel depends on it.

Rollback vs revert vs roll-forward

Aspect

Rollback

Revert

Roll-forward

Direction

Back to prior state

Undo in history

Ahead with a fix

Speed

Minutes

Minutes (new commit)

Variable

Preserves history

N/A (state, not commits)

Yes (new commit)

Yes

Data risk

High if migrations

None

None

Use case

Failing deploy

Buggy commit

Recoverable bug

The rollback flow

sequenceDiagram
  participant M as Monitor
  participant E as Engineer
  participant LB as Load balancer
  participant O as Old version
  participant N as New version
  N->>M: Errors spike
  M-->>E: Alert
  E->>E: Decide rollback
  E->>LB: Route to old
  LB->>O: Serve old
  Note over N: New version isolated
  E->>M: Verify
  M-->>E: Baseline restored

Timeline

  1. 1976 — System R introduces SQL transactions with ROLLBACK.

  2. 1990s — Release management formalizes deployment rollback.

  3. 2010 — Continuous Delivery (Humble/Farley) codifies rollback as requirement.

  4. 2014 — Canary releases make rollback a routing change.

  5. 2016 — Google SRE book formalizes error budgets and rollback triggers.

  6. 2020 — Kubernetes rollout undo becomes standard.

How to rollback in under five minutes

A rollback you can actually execute

  1. Pre-deploy the old version

    Blue/green: the old environment stays warm. Canary: the old slice keeps serving. Never delete the old artifact on deploy.

  2. Script the reversal

    ./rollback.sh beats a wiki with twelve steps. Automate the flip.

  3. Monitor the trigger

    A rollback triggered by a human reading a dashboard is slow. Trigger on error rate above threshold, automatically.

  4. Test the rollback path

    A rollback that has never been exercised is not a rollback. Fire it monthly, even if not needed.

  5. Keep migrations reversible

    A schema change without a down migration cannot be rolled back. Write both. Test both.

Common failures

Origin

The word is a compound of roll (turn over) and back (to a prior position). Its first uses were mechanical: rolling a scroll back, rolling dice back. Adventure games in the 1970s borrowed it for saving and loading state. Database systems (System R, 1976) adopted it for the transaction operation that undoes changes. Software deployments inherited it from database practice, where the metaphor fit: roll the state back to where it was before the bad thing happened.

Rollback is not a feature. It is a precondition. A deployment that cannot be rolled back is a deployment that can only be pushed forward into the unknown.

— Google SRE Book, Chapter 8, 2016 (paraphrase)
1976 · ROLLBACK en SQL (System R)
2010 · Continuous Delivery exige rollback
2014 · Canary reduce rollback a cambio de ruteo
2016 · SRE book formaliza triggers
5 · minutos es el target operativo

Evidence

FAQ

When to trigger a rollback?

When error rate, latency or business KPI exceeds threshold after deploy. The trigger must be measurable and automated.

Rollback vs revert?

Rollback restores the deployed state (infrastructure). Revert undoes a commit (source code). You rollback a deploy and revert a commit.

What about irreversible migrations?

Write down migrations. If data was lost, restore from backup. Rollback stops being a minute and becomes an hour, so plan accordingly.

Can rollback be automatic?

Yes, and it should be. Monitor → threshold → trigger → route back. Human-in-the-loop adds minutes.

Connections

Etymology

Origin: compound

  • roll (verb): from Old French rolle, from Latin rotulus, "a little wheel"
  • back (adverb): Old English bæc, to a prior point

Semantic network

RollbackoperationsdevopsDeployBuildCanaryBlue/greenObservabilmigration

● broader ● narrower ● related

Broader

  • operations
  • devops

Related

Used in the garden

Sources