Adding a new column to an existing table sounds simple. In practice, it can introduce locking, rewrite operations, or unexpected performance regressions. The risk grows with dataset size and relational complexity. A single careless migration can block queries, stall background jobs, and trigger alerts across the stack.
Approach schema changes with precision. For small tables, a straightforward ALTER TABLE ... ADD COLUMN works. But on large, high-traffic tables, even adding a nullable column can block writes if your database engine needs a full rewrite. Before you execute, check the database’s documentation on online DDL capabilities. PostgreSQL can add some column types instantly if they have defaults defined as constants. MySQL supports ALGORITHM=INPLACE or INSTANT for compatible changes on recent versions.
Deploy new columns in controlled steps. First, add them without non-null constraints or heavy defaults. Next, backfill in small batches to avoid long-running locks. Finally, enforce constraints once the data is ready. Migrations should be versioned and executed by an automated deploy process, never from a developer’s laptop.