The query slowed to a crawl. Reports filled the dashboard. The problem was simple: the database needed a new column.
Adding a new column sounds small. It is not. Schema changes shift the shape of data in ways that ripple across code, APIs, and jobs. If you drop it into production without a plan, downtime and broken features follow.
The first step is knowing why the new column exists. Define its exact purpose. Will it store derived values, flags, or external IDs? Lock that down before writing any ALTER TABLE statement. Unclear requirements cause rework and delay.
Next, assess impact. In relational databases like PostgreSQL and MySQL, adding a column with no default can be nearly instant. Adding one with a default value can lock the table. For large datasets, this lock can stall production queries. Use NULL defaults when possible, backfill in batches, then enforce constraints later.
Check application code. ORM models, serializers, migrations, and tests must support the new column. In distributed systems, deploy code that can read and ignore the column before writing to it. This ensures forward and backward compatibility during rollout.