A schema change just dropped, and it’s time to add a new column. The database is live. Queries are running. There’s no maintenance window. You need it to happen without breaking the world.
Adding a new column is not just an ALTER TABLE statement. On large datasets, blocking operations can lock writes, spike latency, and take services offline. Every platform handles column additions differently, and the wrong move can trigger a cascade of failures.
In PostgreSQL, ALTER TABLE ... ADD COLUMN with a default value rewrites the table, which can be catastrophic at scale. Without a default, the operation completes instantly, but your application must handle nulls until backfilled. MySQL behaves differently: adding a column may require a full table copy unless using ALGORITHM=INPLACE or ALGORITHM=INSTANT. Even then, certain options like changing column order or adding a default can force a rebuild.
Backfilling the new column safely is as critical as creating it. Use batched updates with controlled transaction sizes to avoid saturating I/O and replication lag. Monitor lock times. Watch for query plans that change when the new column appears in indexes. Run the migration in shadow first.