Adding a new column is one of the simplest operations in a database. It’s also one of the most dangerous when done in production. The risk isn’t in the syntax—it’s in the scale, the load, and the way the migration interacts with live reads and writes.
In PostgreSQL, adding a nullable column with a default can lock the table. In MySQL, a large ALTER TABLE can block queries and cascade failures across services. Even in modern cloud databases, schema changes can spike CPU, hold locks, and create replication lag. The right approach depends on your database engine, dataset size, and uptime requirements.
Best practice is to break the change into steps. First, add the new column without defaults or constraints. Then backfill data in batches. Finally, apply defaults, indexes, or foreign keys in separate operations. This reduces lock times and avoids overwhelming replicas. Migrations should run through tooling that can track progress, handle retries, and fail fast on errors.