Adding a new column is more than changing a table definition. It touches performance, schema integrity, and deployment safety. The wrong approach can lock tables, block writes, and cause downtime. The right approach is fast, atomic, and predictable.
First, decide the exact name, type, and nullability of the new column. Choosing NULL by default avoids immediate data rewrites, reducing migration time. Use DEFAULT values only when necessary, as this can trigger a full-table update.
In SQL, a simple ALTER TABLE ADD COLUMN works for small datasets. On large tables, use an online migration strategy. Apply the schema change in a separate migration file managed by your migrations tool. Execute it in a low-load window or run it in a way that does not block concurrent queries. Many modern databases, like PostgreSQL with certain column types, can add a new column instantly. But adding indexes or foreign keys afterward often requires careful sequencing.