Adding a new column is one of the most common schema changes in a database. It sounds simple. It is not trivial. Done wrong, it can lock tables, block writes, and cause downtime. Done right, it slides into production without users noticing.
The first step is knowing what kind of database you use. In PostgreSQL, ALTER TABLE ADD COLUMN is the entry point. If the column has a default value, the database may rewrite the entire table. That is a problem in large datasets. To avoid blocking writes, add the column as nullable first, then backfill it in small batches, then set the default and constraints.
In MySQL, adding a column can lock the table, depending on the storage engine and column definition. Online schema change tools like gh-ost or pt-online-schema-change can create a shadow table, copy data in chunks, and swap it in with almost zero downtime. These tools need careful configuration to handle replication lag and avoid breaking transactions.
In production environments, always test the migration on a staging database with similar size and load. Monitor I/O, replication, and query performance during the change. Automate rollback steps so you can revert fast if the new column causes issues.