Adding a new column looks simple. It isn’t. Do it wrong and you lock the table, stall writes, and break the flow for every connected service. The right approach depends on engine, scale, and workload.
In PostgreSQL, ALTER TABLE ADD COLUMN runs in constant time for most cases—it updates the metadata, not the existing rows, if a default is null. But the moment you set a non-null default, the database rewrites every row. That means locks, I/O, and pain. MySQL has similar traps depending on the storage engine.
On large tables, the safe path is to add the column with a null value, backfill in batches, and then set constraints or defaults. This avoids long locks and lets you monitor performance during the migration. Always test the migration on a staging clone with production-like data.