Adding a new column is one of the most common schema changes in any database. It feels simple, but at scale it can grind deployments to a halt, block writes, or trigger hours of migration time. The difference between a smooth change and an outage is preparation.
The first step is choosing the right migration strategy. In PostgreSQL, ALTER TABLE ADD COLUMN with a default value rewrites the entire table. On large datasets, that’s an immediate performance and availability risk. In MySQL, adding a column can lock writes depending on the storage engine and version. These details matter.
The safer path is to add the column without a default, backfill in batches, then set the default and constraints afterward. This avoids long locks and keeps production write throughput stable. Use feature flags or versioned application code so the new column is only read and written once it’s fully populated.