Adding a new column to a database is one of the most common schema changes. It looks simple, but under load, it is where many systems stall. Get it wrong and you block writes, spike latency, or even lock the whole table.
The first step is choosing the right migration method. For small, low-traffic tables, an ALTER TABLE ADD COLUMN is safe and fast. For large tables in production, run non-blocking migrations. On PostgreSQL, adding a nullable column with no default is instant. On MySQL, use ALGORITHM=INPLACE when possible.
Define the exact data type and constraints up front. Changing them later is more disruptive. Avoid adding NOT NULL with a default to giant tables in one step—it rewrites the table. Instead, create the column as nullable, backfill in batches, then enforce constraints.
When backfilling data for a new column, throttle writes and monitor replication lag. Use small transactions to reduce lock contention. Test the migration path in a staging environment with production-like data sizes to validate performance.