The schema was breaking, and the only fix was a new column.
Adding a new column is one of the most common schema changes in modern databases, yet it’s where projects often slip. Downtime, lock contention, deployment delays—small mistakes multiply fast. When data grows large and traffic peaks, a poorly executed column addition can stall queries or block writes, sending latency through the roof.
To add a new column in production without incident, start by defining the exact type, nullability, and default value. Avoid implicit defaults in heavy tables—on many engines, this forces a full table rewrite. Check how your database version handles ALTER TABLE operations. Some support instant metadata changes; others rewrite all data.
In PostgreSQL, adding a nullable column without a default is instant, but adding one with a default rewrites every row. In MySQL, ALTER TABLE can lock the table unless you use ONLINE or partitioning strategies. With distributed systems like CockroachDB, altering tables may trigger background migrations that fight for resources.