The table was failing. Queries stalled. Joins became slow enough to notice. You needed a new column, and you needed it without downtime.
Adding a new column to a live database sounds trivial until it isn’t. In production, schema changes can lock tables, spike CPU, and block writes. The wrong migration plan can turn a two-minute deployment into hours of lost service.
A new column should be fast to create, easy to backfill, and safe under load. The exact method depends on your database engine. In PostgreSQL, adding a nullable column without a default is near-instant. Adding one with a default rewrites the whole table, unless you use DEFAULT NULL first, then ALTER COLUMN SET DEFAULT after. In MySQL, ALTER TABLE is blocking by default, but ALGORITHM=INPLACE or tools like gh-ost and pt-online-schema-change can change schema online.