Adding a new column sounds simple. It isn’t. In production, schema changes carry risk. A blocking migration can lock writes. A careless default can spike load. A missed index can turn fast queries into timeouts. The goal is zero downtime, guaranteed data integrity, and predictable performance.
The first step is to add the new column in a non-blocking way. For PostgreSQL, that means avoiding operations that rewrite the whole table unless absolutely necessary. Use ALTER TABLE ... ADD COLUMN with defaults set after the column exists, not during creation. In MySQL, watch for table copy operations depending on the engine and version.
Second, backfill data in small batches. This keeps transactions short, reduces locks, and prevents replication lag. Schedule the backfill to run during low traffic windows, but design your batch job to pause or slow down if latency spikes.