Adding a new column should be simple. In practice, it can bring production to its knees if done carelessly. Schema changes must respect uptime, data integrity, and downstream dependencies. A single blocking DDL can lock tables, stall requests, and trigger timeouts.
The first step is understanding your database engine’s behavior. In PostgreSQL, adding a column without a default is fast—metadata only. Adding one with a default on a huge table is dangerous. In MySQL, even a basic ALTER TABLE may rewrite the entire dataset, depending on the storage engine and version.
Online schema change tools ease this pain. For MySQL, gh-ost or pt-online-schema-change can add a new column without locking reads or writes. PostgreSQL offers ADD COLUMN instantly, but populating it should happen in small, batched updates to avoid I/O spikes.
Application code must handle the transition cleanly. Deploy the schema change first, then roll out the code that writes to the new column. Only after both are stable should you backfill historical data. This avoids null access errors and broken queries.