Migrating Data Quickly and Safely
summary
Nextdoor deploys 10–15 times per day and solves long blocking DDLs by keeping Django migrations but adding safety checks that query Postgres’ information_schema and other catalog views to verify a column/index/trigger already exists before inserting the migration row. Developers run the generated SQL in staging and production (create column, backfill, then add constraint), merge, and automated checks either let Django mark the migration applied or page devtools on failure. Median read is ~900µs, alter table lock time ~25–30ms; system works for most cases but expensive ops like heavy backfills or long create index concurrently still require offline or scheduled windows.
AI-written summary · about
chapters (7)
- 0:00Start
- 5:38Continuous Deployment
- 6:48Backwards Compatibility
- 10:54Lock Contention
- 24:31Safety Checks
- 25:41Safety Check
- 26:59Takeaways
related talks
33mPeaceful Django Migrations with Efe Öge
46mPostgreSQL Beyond Django: Strategies to Get Max Performance with Álvaro Justen
40mrails db:migrate:safely
33mAdding zero-downtime migrations strategy in SaaS project
31mSpace Django: Migrating and Redesigning a Database while Hunting for Satellites.
25mDeploying Django migrations at Kraken scale with Tim Bell
23mDjango with PostgreSQL superpowers
26mDjango migrations, friend or foe? Optimize them for testing
