Adding a new column sounds simple until it breaks production. In most systems, schema changes are risky because they affect code paths, query plans, and performance. The key is to design the migration so the database stays online and the application keeps working.
First, create the new column with a default value or NULL. Avoid locking the table for long-running writes. In PostgreSQL, ALTER TABLE ... ADD COLUMN with a default requires a full table rewrite before version 11; in later versions, defaults are metadata-only. In MySQL, watch the storage engine behavior—InnoDB may copy the table. In large datasets, choose non-blocking schema changes or online DDL.
Second, backfill data in small batches. Never update millions of rows in one transaction. Use an id range or timestamp filter. Commit often to avoid replication lag and transaction bloat. Monitor metrics during the migration.