Adding a new column sounds simple, but the wrong approach costs uptime, locks queries, and slows deployments. At scale, schema changes are a live operation. You need the right method to add a column without blocking reads or writes.
First, confirm the purpose of the new column. Is it for a feature in production or just for analytics? Decide the data type, default value, nullability, and indexing before making the change. These choices affect storage, query plans, and migration speed.
For small datasets, an ALTER TABLE ADD COLUMN runs fast. For large datasets, direct ALTER commands can lock the table for minutes or hours. Instead, use online schema migrations like gh-ost or pt-online-schema-change. They create a shadow copy, apply the change, and swap it in without downtime.