The table was already in production when the request came in: add a new column. No downtime. No broken queries. No angry users staring at a blank screen.
A new column seems simple. It is not. Schema migrations in live systems can lock tables, block writes, or trigger costly full-table rewrites. The right approach depends on database type, data size, and zero-downtime requirements.
In PostgreSQL, adding a new column with a default value before version 11 could cause a table rewrite. Use ALTER TABLE ADD COLUMN without a default, then backfill in batches. In MySQL, adding columns can lock tables unless you use ALGORITHM=INPLACE with supported engines. For large datasets, always test the migration path in a staging environment that mirrors production load.
Null handling matters. Existing rows need a plan: backfilled values, nullable fields, or application-level handling. This impacts query performance and index strategies. If the new column will be indexed, create indexes after the data migration to avoid repeated index updates.