The query ran. The results came back. But the data shape had shifted. You needed a new column.
In databases, adding a new column sounds simple. In practice, it can be a high-stakes change. Storage engines, concurrency locks, migrations, and application code all intersect here. Choosing the wrong method can slow queries, block writes, or corrupt data if not handled carefully.
A new column can store derived values, indexes for faster lookups, or track events the old schema ignored. In relational systems like PostgreSQL or MySQL, ALTER TABLE ADD COLUMN is the standard. But consider defaults. On large tables, setting a default value without a NOT NULL constraint often runs faster. In cloud-scale systems, run migrations as online schema changes to avoid downtime.
NoSQL stores treat a new column differently. Document databases like MongoDB let you start writing new fields instantly. Columns appear only where needed. This flexibility reduces migration time but puts the onus on code to handle missing fields.