Adding a new column to a database sounds small. In production systems, it can disrupt uptime, break data pipelines, and slow queries. Done right, it becomes routine. Done wrong, it locks tables, spikes errors, and wakes teams at 3 a.m.
When you add a new column, design for zero downtime. Use ALTER TABLE with care. On large tables, a blocking DDL can freeze writes for minutes. Consider online schema changes. MySQL’s ALGORITHM=INPLACE or ALGORITHM=INSTANT can help. PostgreSQL often handles adding nullable columns without a table rewrite, but adding a column with a default value may still lock rows.
Plan the deployment in phases. First, roll out code that can handle the old schema and the new column being absent. Deploy schema changes after the code is ready. For high-traffic systems, add a nullable column without a default, backfill it asynchronously, and only then apply constraints or defaults.