The database was choking on a million writes when the command hit: add a new column.
Schema changes are simple in theory. In practice, they can lock tables, break queries, and slow production to a crawl. Adding a new column means altering structure that live systems depend on, often without the luxury of downtime. The choice of method—ALTER TABLE, shadow tables, online migrations—decides whether your service stays up or goes dark.
A new column in SQL is more than an extra field. It shifts indexes, can trigger rebuilds, and may impact replication. On large datasets, a blocking migration can take hours. For distributed databases, the cost multiplies. Failure to plan means failed deploys.
Best practice is clear. First, assess usage and growth of the target table. Next, choose a migration strategy that minimizes locks, such as ADD COLUMN with default NULL and a separate backfill job. Avoid setting non-null defaults in the DDL for huge tables. Use feature flags or code branches to handle reads and writes during transition. Always run the migration in staging with production-size data before promotion.