The query hit hard. We needed a new column in the dataset, and there was no time to refactor the whole pipeline. The schema was locked by production traffic, migrations had to run without downtime, and the release window was closing.
Adding a new column seems simple until it touches live systems. You have to consider database constraints, indexing strategy, default values, and backward compatibility. In relational databases like PostgreSQL or MySQL, an unplanned new column can cause full table rewrites if done carelessly. On large tables, that means locking, degraded performance, or even outages.
The safest approach is incremental. First, deploy a schema migration that adds the new column as nullable with no default. This avoids locking the table for long operations. Next, backfill data in batches to reduce I/O spikes and keep replication lag under control. After verifying consistency, set constraints, add indexes if needed, and update the application code to use the new column.