The database schema had to change, and there was no time to waste. A new column was the fastest way to ship the update without breaking production.
Adding a new column sounds simple, but it can destroy performance or lock tables if done wrong. In high-traffic systems, schema changes must be done with precision. Choose the correct data type. Define nullability. Set defaults only when necessary to avoid large table rewrites.
In PostgreSQL, use ALTER TABLE ADD COLUMN with care. Small changes can trigger massive I/O if the column has a non-null default. In MySQL, older versions rewrite tables for certain changes, while newer versions can add a column instantly under specific conditions. Always confirm your database version and migration path.
Plan for deployment in stages. First, add the column with the safest command your database supports. Deploy. Then, backfill data in controlled batches to avoid locking and contention. Finally, apply constraints and indexes after the data is populated.