A new column sounds simple on paper. In production, it can be dangerous. Schema changes can lock tables, block writes, and cascade failures if handled poorly. The goal is zero disruption. The method must be precise.
Start by checking the database engine’s native support for online DDL. PostgreSQL, MySQL, and MariaDB all have different capabilities. PostgreSQL can add a column with a default value of NULL instantly, but adding a default that is not NULL will rewrite the table and block access. MySQL with InnoDB can do instant adds for certain column types, but large text or blob types may require a copy.
When immediate schema changes are unsafe, use a phased approach. First, add the new column in a non-blocking way—no defaults, no non-null constraint. Second, backfill data in controlled batches to avoid load spikes. Third, add constraints or defaults only after the data is in place. Each phase should be deployed separately and monitored for regressions.