Adding a new column to a production database should be routine, but it’s where downtime and data loss hide. The key is understanding the constraints, locking behavior, and how your migration tool interacts with the underlying storage engine. On modern relational databases, ALTER TABLE can be cheap or catastrophic depending on column type, default values, and indexing.
A new column without a default may write instantly to metadata. A new column with a default value forces a full table rewrite in many systems. Even zero-downtime migrations can stall if you add a NOT NULL constraint at the wrong stage. Break column changes into safe steps: add the nullable column, backfill in batches, then enforce constraints.
For high-throughput services, schema changes must align with deployment pipelines. Gate changes behind feature flags so application code can read and write only when migrations complete. For distributed systems, coordinate database updates with application rollouts to prevent query errors or deserialization bugs.