Adding a new column sounds simple. In production, it is not. Downtime is costly. Migrations can lock tables, block writes, and stall reads. If the dataset is large, every second matters.
A new column begins with a schema change. In SQL, you use ALTER TABLE to define it. On small tables, this runs fast. On large production tables, it can take hours. The database may lock the table during the operation. Your goal is to avoid that lock.
Online schema change tools like pt-online-schema-change or gh-ost can create the new column without blocking. They copy data into a new structure in the background, replaying writes until the switchover. This lets you ship schema changes while traffic flows.
When adding a new column, define the type and constraints with care. A nullable column is cheaper to deploy than one with a default value that triggers a full table rewrite. Adding indexes with the new column can be even more expensive. Split those operations into separate steps.