The migration froze halfway. A new column had just been added to the database, and every service touching that table stalled. The error logs were blunt: schema mismatch.
Adding a new column sounds small. It is not. In production, it changes data contracts, impacts query performance, and can fracture deployments if done without coordination. The risk is amplified when distributed systems, global traffic, and multiple teams are involved.
The safest way to add a new column is to treat it as a multi-step deployment. First, deploy code that ignores the column but remains compatible with both old and new schemas. Then, run a migration to add the column — always with a default or null option to avoid blocking inserts. Finally, deploy logic that writes to and reads from the new column only after data backfill is complete.
Watch for indexes. Creating or altering indexes on a large table can spike CPU and lock writes. Inline index creation with the new column definition may seem efficient, but in high-load environments it is safer to split the steps. Use online DDL tools when the database supports them.
Always benchmark before merging. Even an unused column increases row size and can slow queries on wide tables. Run explain plans before and after. Watch your replication lag. Monitor cache hit ratios if the table appears in hot paths.