Adding a new column should be simple. Too often, it isn’t. The wrong ALTER TABLE can block queries, slow the system, or cause migrations to fail. The right approach keeps production fast and consistent.
When you add a new column, consider its default value and nullability first. Adding a column with a non-null default in some databases rewrites the entire table. That can turn a sub-second change into an hours-long lock. If you must set a default, add the column as nullable, backfill data in small batches, then apply the constraint.
Use online schema change tools where possible. Many platforms now support non-blocking adds for new columns, but you must confirm they work for your database version. MySQL’s ALGORITHM=INPLACE or Postgres’s fast path for metadata-only changes can prevent downtime.