You search the schema. It’s there. You read the migration history. It ran. The tests break anyway. Adding a new column should be simple. In production, one bad alter can lock a table and block writes for seconds or minutes. In continuous delivery, those seconds can sink a deploy pipeline.
A new column in a relational database changes memory layout, storage size, and query plans. Adding a nullable column is usually fast. Adding with a default on a large table can rewrite every row. That means I/O spikes, replication lag, or degraded APIs. The safest approach is stepwise:
- Add the new column as nullable.
- Backfill data in batches.
- Add constraints or defaults after the backfill.
For distributed systems, zero-downtime migration tooling is essential. Feature flags and dual writes protect against partial deploys. Schema diffs should run on staging databases with real-scale datasets before they hit production.