⚙️ Backend Engineering · Databases
Run zero-downtime schema migrations
Expand-contract deployments so schema changes ship without locking tables or breaking running code.
advanced~40 minBackend EngineersAPI DevelopersPlatform Engineers
Steps
- 1Expand: add nullable columns/tables first; deploy code writing both paths
- 2Backfill in batches with sleep/throttling; monitor replication lag
- 3Switch reads to the new shape behind a flag; verify parity metrics
- 4Contract: remove old columns only after N days of clean telemetry
- 5Never rename or drop during peak; schedule low-traffic windows
- 6Test every migration against a production-size snapshot first
Common Pitfalls
- ▲CREATE INDEX without CONCURRENTLY blocking writes
- ▲Deploying code that assumes new column before migration runs
Commands
Install with skills CLI
$ npx skills add aniruddhaadak80/skills --skill databases-zero-downtime-migrationsInstall globally
$ npx skills add aniruddhaadak80/skills --skill databases-zero-downtime-migrations -gTags
#migrations#deployments#sql#backend-engineering#databases