Adding a new column should be simple, but production doesn’t forgive mistakes. Schema changes can lock tables, block writes, and trigger downtime. The right approach depends on scale, traffic patterns, and your migration tooling.
For small datasets, an ALTER TABLE ADD COLUMN runs fast. But as row counts rise, that single command can halt everything. Large-scale systems need an online schema migration. Tools like gh-ost or pt-online-schema-change copy data to a shadow table, apply the new column, then swap it in with near-zero downtime.
Before creation, define the column’s purpose and data type. Avoid defaults on huge tables if they force a full rewrite. Nullable columns often deploy faster. Populate the column in background jobs, updating in batches to reduce load. Only after all rows are filled should you enforce constraints or switch to NOT NULL.