Zero-Downtime Database Migrations with Postgres
Independent review · Reader-supported, we may earn a commission
Expand, migrate, contract: ship schema changes safely.
Expand and contract
- Add the new nullable column
- Backfill in batches
- Switch reads and writes
- Retire the old column
ALTER TABLE users ADD COLUMN display_name text;
Never lock a hot table during peak traffic.
// recommended
You might like these
Linear
SponsoredLinear
The issue tracker developers actually enjoy.
$8.00View offer
Cloudflare
SponsoredCloudflare Workers
Deploy serverless code to 300+ cities instantly.
$5.00View offer
Keychron
SponsoredKeychron Q1 Pro
Wireless 75% aluminum mechanical keyboard.
$199.00View offer