Day 52 of 60
·
Data, ML & infrastructure
Database migration & rollback testing
A migration that locks the table, a backfill that's not idempotent, a rollback that doesn't roll back. Database changes are the deploys most likely to put you on a bridge call. Test both directions, on prod-shaped snapshots.
ProblemA schema migration, backfill, or rollback corrupts data or blocks production traffic.
How it works
Run forward and backward migrations against production-shaped snapshots. Verify lock time, idempotency, compatibility with old and new app versions, backfill resumability, and rollback procedures before release.
What it catches
Destructive migrations, long locks, failed rollbacks, non-idempotent backfills, app/schema incompatibility, and silent data corruption.
Tools
Flyway · OSS Liquibase · OSS Atlas · Hybrid Sqitch · OSS
Verdict by project size
Small
Opt
Medium
Rec
Large
Must
Extra-large
Must
Cost
| Project size | Setup | Maint / mo | Tool / mo | CI / run |
|---|---|---|---|---|
| Small <10k LOC | 4h | 1h | $0 | +1m |
| Medium 10–100k LOC | 2d | 4h | $0 | +3m |
| Large 100k–1M LOC | 8d | 25h | $500 | +10m |
| Extra-large >1M LOC | 25d | 100h | $5k | +30m |
Setup = engineer-days to first useful run ·
Maint = engineer-hours / month at steady state ·
Tool = out-of-pocket $ / month ·
CI = minutes added (or saved) per pipeline run
Lifecycle & ownership
When in lifecycle
Build Release
Per release · Runs before promotion to production.
Who owns it
Data Engineer
Pipelines, schemas, lineage
Collaborates with: SRE / DevOps / Platform, Developer, QA / Test Engineer
Reference implementations
-
Flyway tutorials
Versioned database migration workflows and rollback-aware release practice.
-
Liquibase examples
Versioned database change examples and rollback patterns.
-
Atlas examples
Schema migration workflows, linting, and declarative database management examples.
Quick check
Database migration testing must verify what before release?
One question. Pick the best answer. Your streak is saved locally on this device.
Save the lesson
Download SVG ↓Screenshot for a 1:1, drop it in Slack, or download the SVG.