In most systems, adding a new column feels simple until you touch production. Schema changes can cause downtime, lock tables, or create race conditions that leave data incomplete. A single misstep and your migration triggers an outage. This makes the “new column” not just a database task, but a critical deployment decision.
The first question: online or offline migration? For high-traffic applications, online schema changes let you add a new column without blocking reads or writes. PostgreSQL’s ALTER TABLE can be safe for certain column types, but large tables may still cause locks. MySQL’s ALGORITHM=INPLACE or tools like pt-online-schema-change reduce risks, but they require more testing and monitoring.
Second, choose default values carefully. Setting a default on a huge table often rewrites every row, impacting performance. In some databases, adding the column as NULL first, backfilling in batches, then applying the default minimizes both downtime and load.