Adding a new column to a database is one of the most common schema changes in software. It seems simple, but done wrong, it can destroy performance, block writes, or corrupt data. Done right, it’s invisible to users and safe under heavy load.
When you add a new column, the first decision is whether to allow NULL or give it a default value. In PostgreSQL, adding a nullable column is near-instant, but a non-null column with a default rewrites the whole table. That locks rows and can stall production traffic. Avoid that by creating the column as nullable first, backfilling in controlled batches, and then adding the NOT NULL constraint when complete.
In MySQL, the cost of adding a new column depends on the storage engine and the table size. Look for “instant” ALTER TABLE operations introduced in recent versions; otherwise, you may be looking at a full table copy. Always test schema changes on a copy of production data before deploying them live.