Adding a new column should be simple. In many databases, it is a fast metadata change. But when the table holds billions of rows or is under heavy load, the wrong approach can lock writes, spike CPU, or take systems offline. The right strategy depends on the storage engine, schema design, and operational constraints.
First, define the column precisely. Decide on type, nullability, and default values. Avoid defaults that require rewriting every row unless the engine supports instant defaults. In MySQL, ADD COLUMN on InnoDB can be instant for certain cases. In PostgreSQL, adding a nullable column is fast, but adding it with a non-null default rewrites the table.
Second, plan for deployment. Use feature flags or versioned schemas to introduce the new column without breaking code. Update application logic in two stages: write to both old and new schema, then read from the new column after population. This avoids downtime and ensures compatibility during rollout.