Back to Blog
Engineering

Zero-Downtime Database Migrations: Our Playbook

Running schema migrations on a live production database serving thousands of tenants without any downtime.

D
Database Team · Engineering
February 15, 20268 min read
Zero-Downtime Database Migrations: Our Playbook

Database migrations are one of the scariest operations in production. We developed a systematic approach that has let us ship hundreds of migrations without a single minute of downtime.

The Golden Rules

  • Never rename or drop a column in a single deployment
  • Always add new columns as nullable or with a default
  • Use concurrent index creation to avoid table locks
  • Backfill data in batches, never in a single transaction
  • Keep migrations idempotent so they can be safely re-run

The best migration is one your users never know happened.

Database Team