A new column sounds simple. It’s not. Schema changes are a high-risk intersection of code and data. A careless alter statement can lock a table, block writes, and trigger a chain of failures. The right approach depends on table size, traffic patterns, and the database engine.
In PostgreSQL, adding a nullable column without a default is fast. It updates the metadata, not the rows. In MySQL, ALTER TABLE often rewrites the whole table; on large datasets, this can be deadly. Modern versions support instant column addition for certain types, but check the documentation—details matter.
When adding a new column with a default value, avoid setting the default inline on large tables. Instead, add the column as nullable, backfill in small, controlled batches, then apply the default and not-null constraints. This keeps locks short and transactions lightweight.
In distributed systems or with zero-downtime deploys, roll out schema changes in phases: