Step by step
Define forward and backward states
Document the current schema, target schema, data volume, invariants and which application versions must coexist during rollout.
Separate compatible steps
Prefer expand, backfill, switch reads or writes, verify, then contract. Avoid a single change that old code cannot tolerate.
Test on representative data
Measure locks, runtime, storage growth and failure recovery using realistic volume and constraints. Verify backup and restore, not only backup creation.
Instrument and gate production
Choose health metrics, progress checkpoints, abort thresholds, owner and communication path. Make repeated execution safe where possible.
Ready-to-use checklist
- Current and target states documented
- Compatibility window defined
- Representative rehearsal completed
- Backup restore tested
- Abort thresholds set
- Post-migration verification written
Common problems
Rollback would discard new writes
Use a forward-fix or dual-write strategy designed in advance; a schema rollback alone may not restore data semantics.
Backfill overloads production
Throttle batches, use resumable checkpoints and monitor replicas, locks and latency.