Rollback and Migration Safety
Make rollbacks survivable in stateful systems
Reduce incident severity by planning roll-forward over roll-back, enforcing backward-compatible database migrations, and rehearsing recovery paths.
INGREDIENTS
PROMPT
Create a skill called "Rollback and Migration Safety". Ask me for: - Deployment model (blue/green, canary, rolling) - Database type and migration tool - Incident history (what failed in prior rollbacks) Output: - A backward-compatible migration playbook (phased steps) - A roll-forward-first recommendation with when rollback is viable - A rehearsal and verification checklist
How It Works
Rollbacks are often not simple, especially with stateful databases. This recipe introduces
a safer change model: backward-compatible migrations, feature flags, and practiced recovery.
Triggers
- Rollbacks frequently fail or require "surgery"
- Database migrations cause late-night incidents
- Change failure rate and MTTR are high
Steps
- Prefer roll-forward fixes by making pipelines fast and reliable.
- Make schema changes backward compatible:
- add new columns first,
- deploy code that supports both,
- migrate data,
- only then remove old fields.
- Separate schema deploy from feature exposure using flags where feasible.
- Add a migration rehearsal in staging with production-like data volume assumptions.
- Document and test recovery steps regularly (tabletop or practice run).
Expected Outcome
- Fewer catastrophic rollout failures and faster recovery when failures occur.
- Migration failures become predictable events with known mitigation.
Example Inputs
- "We need zero-downtime migration strategy."
- "Rollback didn't work last time; we need a safer approach."
- "How do we keep code compatible with one DB change ahead?"
Tips
- If rollback is your plan, ensure you can actually execute it under pressure.