Schema changes look harmless. One line in a migration. A small update. But in production, a poorly planned ALTER TABLE ADD COLUMN can lock tables, block writes, and stall entire services. For systems with millions of rows, adding a new column without strategy is a risk you can’t ignore.
The first decision: nullable or with a default. A nullable new column is quick to add because the database doesn’t rewrite every row. A new column with a non-null default forces a table rewrite, which can mean minutes or hours of downtime under load. If you need a default, set it to null first, backfill the data in batches, then apply the constraint.
The second step: choose the right migration path for your engine. PostgreSQL, MySQL, and others each handle ADD COLUMN differently. PostgreSQL can add a nullable column instantly, but a column with a default triggers a full rewrite pre-11.2. MySQL may block during schema changes unless you use tools like pt-online-schema-change or native online DDL.