Database Migrations in Production: Schema Changes Without Downtime
The migration ran in 40 milliseconds and still caused an outage. Production schema changes fail in two ways: the old code can't handle the new schema during a rolling deploy, or a quick ALTER waits on a lock and freezes every query behind it. Here's the expand/contract pattern, the locking traps, and how to change a schema under live traffic.