Adding a new column sounds simple. It rarely is. The wrong approach can lock your table, slow writes, or cause downtime. The right approach is precise, tested, and fast.
In SQL, the ALTER TABLE statement is the standard way to add a new column. On small tables, this change is instant. On large production datasets, it can be dangerous. Row-by-row rewrites will block the table. Long-running migrations risk failure mid-change. And when you run multiple services against the same schema, a single blocking lock can cascade into outages.
Modern databases offer safer paths. Some support online schema changes, letting you add a new column without locking writes. Tools like pt-online-schema-change or gh-ost perform this by copying rows to a shadow table and swapping them in once complete. Column defaults and nullability should be chosen with care: non-null columns with defaults often require a full rewrite.