The build was done. The data looked solid. Then came the change request: add a new column.
Adding a new column to a production database should be simple. Too often, it isn’t. Schema changes can block deployments, lock tables, cause downtime, or trigger costly reindexing. Even small changes hold risk when the dataset is large and live traffic is high.
A new column means modifying the schema. In SQL databases, you run an ALTER TABLE command. This tells the database to update the table definition and include the new column name, type, and constraints. On small tables, the change is fast. On big tables, it can lock writes or even the entire table until the operation completes. This is why engineers often use rolling migrations, background jobs, or online schema change tools.
In PostgreSQL, adding a new column with a default value before version 11 rewrote the entire table. Newer versions can add a column with a constant default almost instantly. In MySQL, tools like pt-online-schema-change or gh-ost can help avoid lockups. In cloud environments, some managed databases now support truly online DDL for adding columns without user-visible interruptions.