Adding a new column is one of the most common schema changes in relational databases. Done poorly, it stalls deployments and locks writes. Done well, it’s invisible to the application and the users. The process depends on the engine, the table size, and the operational constraints.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast if you set a default of NULL because it only updates the metadata. Assigning a non-null default, however, will rewrite the entire table, which can be catastrophic for large datasets in production. MySQL with InnoDB can add a column instantly in some cases using “instant DDL,” but not all operations qualify. Knowing the specific behavior of your database engine is the first step.
For zero-downtime migrations, a common pattern is to first add the new column as nullable. Then backfill data in controlled batches using application code or migration scripts. Once the column is fully populated, set constraints and defaults. This staged approach avoids long locks and write blocking.