The request to add a new column hit the system at 02:13 UTC. Two hundred million rows stood in the way.
A new column is never just a schema change. It is a shift in how data is stored, indexed, and retrieved. The wrong approach can lock tables, block writes, and stall entire pipelines. The right approach makes the change invisible to users and safe for production.
Relational databases handle a new column in different ways. In PostgreSQL, adding a nullable column without a default is instant because it only updates metadata. In MySQL, the operation can be fast with ALGORITHM=INSTANT in modern versions, but still triggers a full table rewrite if defaults are set at creation. In distributed databases like CockroachDB or YugabyteDB, schema changes roll out in phases, letting nodes handle updates without global locks.
When adding a new column to a large dataset, the safest path often starts with no default value. Apply the column as metadata only. Update data in batches using background jobs, applying indexes and constraints after backfill. Monitor replication lag and query performance as you go.