Adding a new column sounds simple. It isn’t. In production, it can break queries, inflate table size, and lock writes. A careless migration can stall an entire service. The key is to plan, test, and release with zero downtime.
First, define the purpose of your new column. Decide on data type, nullability, and default values. If you add a column with a non-null default to a huge table, the database may rewrite every row—a blocking operation in many engines. To avoid downtime, add the column as nullable first, backfill in batches, then set constraints and defaults.
Use migration tools that handle schema changes safely. In Postgres, ALTER TABLE ADD COLUMN without a default is fast. Apply defaults in a follow-up update. For MySQL, watch for table lock behavior; use ALGORITHM=INPLACE where possible. In distributed systems, deploy migrations alongside code that can handle both old and new schemas.