The schema was tight, but the feature demanded one more field. You needed a new column. The pressure was not in the syntax. It was in the production database, already serving thousands of requests per second.
Adding a new column is not just an ALTER TABLE command. It is a decision with direct impact on performance, availability, and future maintainability. The first step is to decide the data type and default values. Make them explicit. Avoid implicit conversions that bloat storage or slow queries.
In relational databases like PostgreSQL or MySQL, a blocking column addition on a large table can lock reads and writes. For high-traffic systems, use non-blocking migration patterns. Add the column with no default, backfill data in small batches, then set the default or constraints once existing rows are updated. This avoids downtime and reduces replication lag.
Consider indexing only after the data is ready. Creating an index on a new column with millions of rows can stall the cluster if done in one step. Many databases offer concurrent or online index creation—use it.