Skip to main content
System Design8 min read

Zero-Downtime Database Migrations: The Expand-Contract Pattern in Production

How to rename database columns and alter schema types on 500-million row Postgres tables without holding table locks.

Zero-Downtime Database Migrations: The Expand-Contract Pattern in Production Cover

Postgres Schema Architecture

Phase 1: Expand, Phase 2: Dual Write & Backfill, Phase 3: Contract.

SHARE ARTICLE

About the author

developerOS

The official developerOS team account.

Keep reading

Insights has no comments. See more from this author, browse the topic, or get new articles by email.

Explore More

Read Next on Insights

More in System Design
DeveloperOS Insider

Join the Insights Newsletter

Get direct engineering insights, Cloud tutorials, career prep guidebooks, and system design breakdown analyses sent straight to your inbox.