The fix started with a new column.
Adding a new column is one of the most common schema changes in modern systems. It looks simple in the migration file, but it has consequences at scale. Schema changes trigger locks, rewrite indexes, and can cause downtime if poorly executed. On distributed databases, adding a column can create replication delays and spike CPU usage. In event-sourced systems, it changes serialization formats and can break consumers.
Before you add a new column, define the purpose and type. Decide if it will be nullable or have a default value. Nullability affects backfilling complexity. Defaults impact write amplification. On large datasets, backfill in small batches and monitor the query plan. Avoid expensive full-table rewrites during peak traffic.
Many developers treat adding a column as purely a database concern. It is not. Every new column changes API contracts, ETL jobs, and analytics models. Indexing it may speed queries but increase write latency. Failing to index it may cause slow data access paths. Understand the read and write patterns before adding indexes.