The migration window was tight, the queries were hot, and the database could not stall.
Adding a new column is simple in concept but dangerous in production. It can break indexes, block writes, and lock tables. In large systems, even a default value can trigger a full rewrite of storage files. That’s why a New Column operation must be planned with precision.
First, profile the size of the table and estimate the migration time. Use EXPLAIN plans and ANALYZE to see the impact on query paths before and after adding the column. Avoid blocking schema changes on high-traffic datasets. For systems like PostgreSQL, consider ADD COLUMN without defaults, then backfill in batches. For MySQL, check if your engine supports instant column addition.
Second, keep application code in sync. Ship code that tolerates the column being absent or null before the schema change. Deploy code that starts writing to the new column only after it exists. Read paths should handle both states until the migration is complete.