Adding a new column can be trivial—or it can be the reason your migration halts production. The difference lies in how you design, deploy, and backfill.
A new column in a relational database changes the shape of your data model. In SQL systems like PostgreSQL or MySQL, you can add it with a simple ALTER TABLE statement. But simplicity is deceptive. Adding a nullable column is usually instant. Adding a non-nullable column with a default can lock the table. On large datasets, that lock can block writes.
Plan the schema change. In zero-downtime systems, you often add a nullable column first, deploy the code to write to it, backfill in small batches, then enforce constraints. This order preserves availability and reduces migration risk.
Consider indexing. An index on the new column may speed queries but slow inserts. Build indexes concurrently when the database supports it. On PostgreSQL, CREATE INDEX CONCURRENTLY avoids locking reads and writes.