You needed a new column—fast. No downtime. No broken queries. No noise.
Adding a new column sounds simple until it’s not. Schema changes can lock tables, slow reads, or create race conditions. Safe, controlled changes demand planning. You define the column’s type, set defaults, and decide whether it can be nullable. You run the migration in a way that avoids blocking writes on large datasets.
In PostgreSQL, a new nullable column with no default is instant. But a column with a default writes to every row, which can be expensive. One fix is to add it as nullable, then backfill in small batches, and finally set the default. In MySQL, adding a column often requires a table rebuild depending on the storage engine and version. This can cause significant delays on large tables unless you use tools like pt-online-schema-change or gh-ost.