TECHNICAL ESSAYDevOps

The Playbook for Zero-Downtime Database Migrations at Scale

Expand-and-contract schema migrations, shadow tables, and dual-writing strategies for 50k QPS workloads.

Alex Rivera
Alex Rivera
Staff Infrastructure Engineer
·
Published on Aug 24, 2026
8 min read
The Playbook for Zero-Downtime Database Migrations at Scale

Altering a billion-row table in production is nerve-wracking. Learn the exact four-phase pattern used by top engineering teams to migrate schemas without downtime.

1. The Expand and Contract Pattern

Directly executing ALTER TABLE ... ADD COLUMN with non-null defaults locks tables and brings down production APIs. The expand-and-contract pattern decouples schema addition from column deletion across separate deployments.

Alex Rivera

Written by Alex Rivera

Building resilient distributed systems and vector database engines. Previously at AWS & Stripe.

Discussion (45)

Markdown supported
*bold*`code`

No comments yet. Start the discussion!