The database migration ran clean, but the product team wanted more. A new column had to be added to production. Zero downtime. No surprises.
A new column is common, but it has risk. It changes the schema, the queries, and sometimes the application logic. The wrong approach can lock a table, trigger outages, or corrupt data. A safe process treats the database like a living system—measured changes, tested paths, and clear fallbacks.
Start by defining the new column with a default that avoids mass updates in one transaction. Use NULL for initial creation when possible. This prevents locks and lets you backfill data in small batches. Avoid adding constraints or indexes in the same step. Each step should be isolated in its own migration to keep the scope predictable.
For backfilling, run an idempotent script. Chunk your updates with LIMIT and OFFSET or use primary key ranges. Monitor throughput against replication lag and lock waits. If the system is high-traffic, schedule during low usage windows or throttle batches dynamically.