The database was fast, but the schema failed to keep pace. A new feature demanded flexibility, yet the tables were rigid. The only way forward was a new column.
Adding a new column is the most common schema migration in production systems. It looks simple, but done wrong it will block writes, lock tables, or trigger hours of replication lag. Done right, it is invisible to the end user.
Before creating a new column, verify its necessity. Review read and write patterns. Check if denormalization or an indexed view can solve the problem. If the schema change is inevitable, plan for zero downtime.
In PostgreSQL, ALTER TABLE ADD COLUMN is usually fast for nullable, non-default columns. For columns with defaults, use a two-step migration: add the new column without a default, then update existing rows in batches, then set the default for future writes. In MySQL, especially with large tables, use ALGORITHM=INPLACE where possible to avoid table rebuilds, or leverage online schema change utilities like pt-online-schema-change or gh-ost.