Adding a new column sounds simple, but in production systems it triggers a chain of risks: downtime, data loss, and unexpected query slowdowns. The wrong migration can stall deploys or even block writes. The right migration is invisible to users, safe under load, and easy to roll back.
When you add a new column to a relational database, plan the change in small, reversible steps. Use migrations that default to NULL or computed values before enforcing constraints. For large tables, avoid locking writes with a direct ALTER TABLE ADD COLUMN. Instead, create the column in a non-blocking migration, backfill in batches, then apply constraints when the data is complete.
In MySQL and Postgres, concurrent operations reduce downtime, but they need careful index creation. Postgres supports ADD COLUMN instantly for nullable fields, but a default value rewrite can scan the entire table. MySQL may copy the table depending on engine and column type. Test in a staging environment with production-sized data before touching live systems.