A new column in a relational database is more than a schema change. It is a live mutation of a system that may be under constant load. The right process for adding it depends on the database engine, the data volume, and the application’s tolerance for downtime.
Start with the DDL. In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward and usually fast when adding a nullable field without a default. Adding a default or a NOT NULL constraint on a large table will lock writes and reads until completion. MySQL behaves differently: some operations are instant in recent versions, but others still cause table copies. Know the cost before you run the command.
Plan for backfills. Adding a nullable column first, then progressively updating data in small batches, avoids blocking locks. Once the column is fully populated, constraints or defaults can be added safely. Tools like pt-online-schema-change or gh-ost can reduce risk on MySQL. For PostgreSQL, consider logical replication or background jobs for safe updates at scale.
Test on realistic data sizes. Synthetic small datasets do not reveal lock times or I/O load under production conditions. Benchmark migrations on staging with the same indexes, row counts, and traffic patterns.