Adding a new column is one of the most common database changes. It sounds simple. It can take down production if done without thought. The way you add it matters: size, defaults, nullability, indexing. Fail to plan and you trigger locks, replication lag, and broken queries.
First, analyze the impact. In most relational databases—PostgreSQL, MySQL, MariaDB—adding a nullable column without a default is near-instant. Adding a column with a default in older versions rewrites the table, which can block writes for large datasets. In PostgreSQL 11+, adding a column with a constant default is fast but backfilling still costs I/O if you update existing rows.
When adding a new column to support features, decide on constraints early. If you can tolerate NULLs at rollout, add the column, deploy, backfill asynchronously, then add the not-null constraint later. This pattern avoids long locks while keeping data integrity.
Index creation for the new column should often be deferred until after backfill—building an index on a populated column burns CPU and I/O. Use concurrent index builds where supported to reduce lock time.