The migration was urgent. A single table needed a new column, and the deadline was not moving.
Adding a new column should be simple, but the wrong approach can lock rows, stall writes, and bring production to its knees. The safest way starts with knowing the database engine, the table size, and the data type. For small tables, an ALTER TABLE ADD COLUMN with a default value is fast. For large tables in heavy use, it can block or trigger a rewrite.
Plan the schema change like a deploy. In Postgres, adding a nullable column without a default is instant. In MySQL, use ALGORITHM=INPLACE when possible. Avoid backfilling data in the same transaction. Instead, add the column, then fill it in batches to reduce load. In distributed systems, coordinate column additions with schema versioning. Deploy code that ignores the missing column first, then add the column, then begin writing to it.