Adding a new column is one of the most common schema changes in database work. It looks small, but it can halt deploys, break queries, and lock tables if done wrong. The right approach depends on the database engine, data size, and traffic patterns.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast for empty defaults, but adding a non-null column with a default value rewrites the table. For large datasets, that can block writes and cause downtime. In MySQL, adding a column can trigger a table copy unless you use ALGORITHM=INPLACE or ALGORITHM=INSTANT when available. Both systems need careful planning for indexes, constraints, and replication lag.
Safe rollout patterns rely on incremental changes. First, add the new column as nullable without a default. Deploy code that can handle nulls. Backfill data in controlled batches to avoid load spikes. Once the column is fully populated, enforce constraints and set final defaults. This sequence minimizes risk in high-traffic systems.