The migration script failed at 2 a.m. because of a missing column. You stare at the schema diff. One change, one oversight, and the deployment halts. Adding a new column should be simple. But in production systems with live traffic, nothing is truly simple.
A new column in a database table can change query performance, alter storage layouts, and impact replication lag. When introducing a column, you need to consider the default value, nullability, and whether the column must be backfilled. You also need to plan for how client code interacts with it before and after deployment.
In PostgreSQL, adding a nullable column without a default is instantaneous. Adding a column with a default on a large table can lock writes and create downtime. In MySQL, adding columns may rebuild the entire table unless you use ALGORITHM=INPLACE or leverage gh-ost or pt-online-schema-change. With distributed databases, schema changes propagate across nodes and can cause version drift if not coordinated.