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
1976 — System R introduces SQL transactions with ROLLBACK.
1990s — Release management formalizes deployment rollback.
2010 — Continuous Delivery (Humble/Farley) codifies rollback as requirement.
2014 — Canary releases make rollback a routing change.
2016 — Google SRE book formalizes error budgets and rollback triggers.
2020 — Kubernetes rollout undo becomes standard.
How to rollback in under five minutes
A rollback you can actually execute
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.
Script the reversal
./rollback.shbeats a wiki with twelve steps. Automate the flip.Monitor the trigger
A rollback triggered by a human reading a dashboard is slow. Trigger on error rate above threshold, automatically.
Test the rollback path
A rollback that has never been exercised is not a rollback. Fire it monthly, even if not needed.
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)
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
- deploy
- build
- canary
- blue-green-deployment
- observability
- migration
Beyer, B. et al. (2016). Site Reliability Engineering, Chapter 8. https://sre.google/sre-book/release-engineering/
Humble, J. & Farley, D. (2010). Continuous Delivery. https://continuousdelivery.com/
Kubernetes (2024). kubectl rollout undo. https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
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
● broader ● narrower ● related
Used in the garden
- The Zero-Downtime WordPress Migration Blueprint for High-Stakes Sites (8×)
- Mastering Database Schema Version Control: The DevOps Secret Weapon (5×)
Sources
Beyer, B. et al. (2016). Site Reliability Engineering, Chapter 8. https://sre.google/sre-book/release-engineering/
Humble, J. & Farley, D. (2010). Continuous Delivery. https://continuousdelivery.com/
Kubernetes (2024). kubectl rollout undo. https://kubernetes.io/docs/concepts/workloads/controllers/deployment/