Adding a new column to a production database sounds simple until you run it on a table with millions of rows. Schema changes can lock writes, block reads, and turn a high-traffic app into a wall of timeouts. A naive ALTER TABLE ADD COLUMN on MySQL or Postgres can cascade into downtime.
The safe approach is controlled execution. On Postgres, use ALTER TABLE ... ADD COLUMN with a default set to NULL first, then backfill in small batches. On MySQL, lean on ALGORITHM=INPLACE when possible, or use tools like pt-online-schema-change to avoid table locks. Always monitor replication lag before and after.
When you must add a column with a default value, separate schema change from data migration. First, add the column nullable. Then run an update in chunks. Finally, add constraints once data integrity is confirmed. This avoids full table rewrites during the initial ALTER.