Adding a new column in production is not just a schema change—it’s a live operation that can slow queries, lock tables, and break code paths if handled carelessly. At scale, the wrong migration strategy can cascade into outages. That’s why the choice of approach matters.
First, decide how the new column fits into the model. Determine data type, default values, nullability, and indexing before touching anything. In Postgres, an ALTER TABLE ... ADD COLUMN is usually fast for nullable, unindexed fields. For large datasets, adding a column with a default value will rewrite the table, which can be expensive. Instead, add the column without the default, then backfill in controlled batches, and finally set the default if needed.
In MySQL, consider whether the engine supports instant adding of columns (as with InnoDB in newer versions). If not, the migration may rebuild the table. Use tools like pt-online-schema-change or gh-ost for non-blocking execution.