The table was running hot, queries stacking, and there was no room left. You needed a new column.
Adding a new column sounds small. It is not. Done wrong, it will lock rows, stall requests, and spill into production impact. The method and timing determine if it’s seamless or a disaster.
Start by defining the change. Is it nullable? Does it need a default? Adding a column with a default value writes to every row, which can lock the table on large datasets. The safer route is to add it nullable, backfill in batches, then set the default or NOT NULL constraint after the data migration.
In MySQL, PostgreSQL, and other relational databases, adding a new column in a live system calls for caution. Use ALTER TABLE with minimal locks when available. In PostgreSQL, certain ALTER operations are fast metadata changes; others rewrite the entire table. In MySQL with InnoDB, adding a column without a default can be near-instant, provided you skip a full table copy.