Adding a new column to a production database is one of the most common schema changes—and one of the easiest to get wrong. The operation seems simple: modify the table definition, deploy the change, start writing and reading data. In reality, the process can impact performance, block queries, and cause downtime if not planned well.
A new column changes the data model. That means updating the migration, adjusting the code that writes to the table, handling default values, and updating readers like APIs, jobs, and reports. If the table is large, the alter statement can lock it for seconds—or hours—depending on the database engine. Online schema changes reduce this risk, but they require tooling and testing.
In MySQL and Postgres, adding a nullable column without a default is often fast, as the database only updates metadata. Adding a new column with a default value on a large table can be slow because it rewrites all rows. Planning the change in two steps—first add the column as nullable, then backfill in batches—avoids long locks.