The table had stood untouched for years, rows locked in place, columns fixed like concrete. Then the need came fast: a new column—critical data, zero downtime.
A new column seems simple. In most SQL databases, ALTER TABLE ADD COLUMN gets it done. But in production, schema changes are a risk. Blocking migrations can freeze writes. Long locks can cascade into outages. The right approach depends on scale, traffic, and execution path.
For small datasets, adding a new column is often instant. On a terabyte-scale table with constant writes, it can stall performance. Many modern databases support online DDL: operations that add a new column without locking the table. MySQL’s ALGORITHM=INPLACE, PostgreSQL’s ADD COLUMN with a default of NULL, and tools like pg_repack or gh-ost avoid heavy locks. But every system has edge cases—indexes, constraints, default values—that change the cost.