The database was fast, but the feature request was clear: add a new column. No waiting for a redesign. No downtime. Just ship the change and keep the system alive.
Adding a new column sounds simple. In production, simplicity hides danger. Schema migrations can lock tables, slow queries, or trigger cascading failures if they are not planned. The cost shows when traffic spikes and the change collides with real data and live requests.
First, decide if the new column is nullable or has a default value. Large tables make this choice critical. A non-null column with a default can backfill millions of rows and block writes. In many SQL engines, adding a nullable column is instant because it only updates the table metadata.
For PostgreSQL, ALTER TABLE ADD COLUMN is safe with NULL, but defaults for huge tables require care. In MySQL and MariaDB, online DDL features can reduce locks, but version and storage engine matter. For distributed databases, each shard must apply the schema update, which can stagger completion and create temporary inconsistent states.