Adding a new column seems simple. But in production systems with live traffic, downtime is not an option. Schema changes must be safe, fast, and reversible. The wrong migration strategy can block writes, lock tables, or break queries.
The first step is defining why the new column exists. Is it a feature flag, a user setting, or an index key? Deciding the type, nullability, and default values is critical. In most SQL databases—PostgreSQL, MySQL—adding a nullable column without a default is instant. Adding a default with a non-null constraint can rewrite the entire table. That is where online migration tools or staged rollout patterns matter.
For sensitive workloads, create the new column as nullable and populate data in batches. Write application code that can handle both states: with and without the column populated. Once the backfill is complete, enforce constraints in a final migration step. This minimizes locks and keeps queries hot in cache.