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.
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!