Adding a new column is one of the most common database schema changes. Done wrong, it locks tables, stalls queries, and breaks downstream systems. Done right, it rolls out in seconds and scales without impact. The difference is in how you plan, run, and verify the change.
First, define the purpose and data type of the new column. Every choice—whether VARCHAR(255), TEXT, INTEGER, or a timestamp—affects storage size, indexing, and query performance. Pick a sane default or allow nulls to avoid rewriting all existing rows at once.
Next, run the operation in a controlled way. For relational databases like PostgreSQL or MySQL, adding a nullable column can be instantaneous. Non-null with a default will trigger a table rewrite, which can block. Use online schema change tools, migrations that run in stages, or database-native features like CONCURRENTLY where supported.
If the new column needs to be populated, backfill it in batches. Do not run a single massive UPDATE across millions of rows in one transaction. Paginate and commit in chunks to protect locks and replication lag.