The data model was perfect until it wasn’t. A product release landed, a new feature demanded more structure, and the schema had to change. That meant one thing: adding a new column.
A new column sounds simple. It’s not. Done wrong, it stops a deployment cold, locks tables, or triggers hours of backfill work. Done right, it ships without downtime and without risk to production traffic.
Start with the schema migration. Always make it backward-compatible. Add the column as nullable. Avoid default values on creation if the dataset is large—this prevents costly table rewrites. In most relational databases like PostgreSQL or MySQL, adding a nullable column is nearly instant, even on millions of rows.
Next, deploy code that can write to the new column, but not yet read from it. This decouples data migration from application logic. Run migrations in batches if you need to backfill. Monitor query performance. Use indexes only after the backfill is complete—index creation on live traffic can be heavy.