The migration hit production at midnight. By 12:03 a.m., a new column existed in the database, and every query had to respect it. No downtime, no missed index. Just a cleaner schema and a path forward.
Adding a new column is one of the most common schema changes. It can also be the quickest way to break your application if done without care. The operation sounds simple—ALTER TABLE ADD COLUMN—but the execution in a real environment has rules. Disk I/O, locking behavior, replication lag, caching layers, and backfills can turn a trivial change into an outage.
In PostgreSQL, adding a nullable column with a default value can lock the table for the entire operation. MySQL behaves differently, but still has performance pitfalls depending on the storage engine. In high-traffic systems, even milliseconds of lock time can cause spikes in error rates. The safe approach is often incremental: first add the column nullable, then populate it in batches, and finally enforce defaults or constraints.