Adding a new column is one of the most common schema changes. It should be simple. Too often, it isn’t. Production systems carry years of data, complex query patterns, strict uptime requirements. A careless migration can lock tables, stall writes, or break downstream services.
The right approach depends on the scale. In small tables, a standard ALTER TABLE ADD COLUMN can work instantly. In large, high-traffic datasets, an online migration strategy is critical. Use tools or database features that apply changes incrementally. Keep columns nullable until populated. Avoid setting default values that require a full rewrite of the table.
Plan for backward compatibility. Deploy code that can handle the schema before adding the column. Use two-phase rollouts: first add the column, then start writing to it, then finally make it required. This avoids race conditions between application and database change.