Adding a new column in a production database is not just a schema change. It’s a change with consequences. Performance shifts. Data integrity risks appear. Migrations stall under load. The path to doing it right is precise: plan, test, deploy. Skip one step and you set yourself up for outages.
First, decide the column type and default values. Avoid NULL unless it serves a real purpose. Defaults that require computation on each row can lock large tables for unacceptable periods. Use lightweight defaults or apply them later with an UPDATE in small batches.
Second, choose the migration strategy for your scale. Online schema changes with tools like pt-online-schema-change or native database features reduce downtime. But even online operations can spike CPU or block writes under the wrong conditions. Measure first in staging with production-like data.