Adding a new column to a production table is simple only in small data sets. At scale, the wrong approach can lock rows, block writes, and trigger replication delays. Performance drops, and the incident channel lights up.
The safest way to add a new column is with a controlled, staged migration. First, write the migration script so it adds the new column without a default value or heavy constraints. This keeps the operation fast. Then backfill the column in small batches to avoid locking large ranges of data. Apply indexes only after the data is in place and verified.
In PostgreSQL, use ALTER TABLE ... ADD COLUMN for the schema change, and avoid DEFAULT clauses that cause table rewrites. In MySQL, for large tables, check if your engine supports ALGORITHM=INPLACE to speed up the change without a full table copy. Document the migration steps, monitor query latency, and test rollback paths.