Rollback Strategy
Produces a comprehensive rollback plan for every phase of a deployment, ensuring that any change can be safely reversed without data loss, service disruption, or orphaned state.
Guiding Principle
"The measure of a deployment is not how it goes forward, but how gracefully it can go back."
Procedure
Step 1 — Inventory Rollback Surfaces
- List every deployment artifact: code, database migrations, infrastructure changes, config changes, feature flags.
- Classify each artifact's reversibility: fully reversible, partially reversible, irreversible.
- Identify stateful vs. stateless changes — stateful changes require data-aware rollback.
- Map each artifact to its deployment mechanism (CI/CD, manual, IaC).
Step 2 — Design Per-Phase Undo Plans
- For each deployment phase, write explicit rollback steps in reverse order.
- For database migrations: design compensating migrations (down migrations) and verify data integrity.
- For feature flags: define the flag state that restores previous behavior.
- For infrastructure changes: document terraform destroy / rollback commands.
- Estimate rollback time for each phase.
Step 3 — Handle Data Migration Reversibility
- Identify data transformations that are lossy (column drops, format changes).
- Design backup-before-migrate strategies for lossy transformations.
- Create data validation queries that confirm rollback completeness.
- Define the point-of-no-return: the phase after which rollback requires restore-from-backup.
- Document the data reconciliation process if rollback occurs mid-migration.
Step 4 — Validate and Document
- Produce a rollback runbook with step-by-step commands.
- Define rollback triggers: metrics thresholds, error rates, or manual decision criteria.
- Assign rollback ownership: who decides, who executes, who verifies.
- Schedule rollback drills for high-risk deployments.
- Tag each rollback step with evidence level.
Quality Criteria
- Every deployment phase has a corresponding rollback phase.
- Data migration rollbacks are tested against realistic data volumes.
- Point-of-no-return is explicitly identified and communicated.
- Rollback time estimates are stated and validated.
Anti-Patterns
- Assuming all changes are reversible without analysis.
- Writing rollback plans that have never been tested.
- Ignoring data state changes during rollback design.
- Treating rollback as an afterthought instead of a first-class deliverable.