Adding a new column sounds simple until it’s done in production. Schema changes can lock tables, stall queries, or force application errors if handled carelessly. The right approach depends on your database engine, migration tools, and rollout strategy.
For PostgreSQL, adding a nullable column with a default that is not NULL rewrites the table. Under heavy load, this can cause slow writes or prevent access entirely. To avoid this, add the column without a default, then backfill in small batches, and finally set the default in a separate step.
In MySQL, use online DDL where possible. For large tables, ALTER TABLE ... ADD COLUMN with ALGORITHM=INPLACE reduces locking, but capabilities vary by storage engine. Check if your setup supports it before running the migration.