Adding a new column should be simple. It should not slow down releases or block the next deploy. In production systems, every schema change carries risk. The database locks. Old code reads stale data. Migrations crash under load. A single mistake can halt the pipeline.
Plan the new column. Define its name, type, and nullability. Use ALTER TABLE only when you understand the table’s size and indexes. For large datasets, run the change in smaller steps. Add the column without constraints. Backfill in batches. Then apply defaults or foreign keys. This avoids timeouts and lock contention.
Decide on defaults early. If the new column will store calculated data, keep the logic in one place. Write scripts or background jobs for backfilling. Monitor replication lag if the database is sharded or has read replicas. Roll out the code that writes to the new column before code that reads from it.