A schema changes under your hands. The prod build finishes, tests run, and you realize the dataset needs one more field. The new column is not optional.
Adding a new column sounds simple. In practice, it can trigger cascading issues—application errors, migration locks, and stale queries. The cost grows if the table is large or if it lives in a high‑traffic service. A careless ALTER TABLE can block writes, slow reads, or break replicas.
Start by checking the table size and query patterns. If the table is huge, use an online migration tool like pt-online-schema-change or gh-ost. For smaller tables, many relational databases can add a nullable column instantly. Avoid adding a NOT NULL column with no default; it can lock the entire table while rewriting all rows.
Plan the rollout in phases. First, deploy a migration that adds the column as nullable without constraints. Then backfill data in batches to prevent load spikes. Finally, alter the column to enforce NOT NULL or add indexes after the data is consistent.