The query runs fast. The results look clean. Then someone asks for a new column.
Adding a new column should be simple. In practice, it often turns into a migration headache. Schema changes touch storage, indexes, queries, and APIs. Even a single additional field can ripple through every layer of your stack.
Start with the database. Decide if the new column is nullable or has a default value. Non-null columns require backfilling, and large tables will lock during updates unless you use background migration tools or versioned schemas. In PostgreSQL, ALTER TABLE can be efficient with proper defaults, but still be aware of write locks. In MySQL, newer versions support instant DDL for certain operations—check compatibility before assuming it’s safe.
Next, update your ORM models. Adding a new column means changing entity definitions and potentially regenerating code. Ensure the new field type matches the underlying database column type. Keep serialization consistent across all endpoints. A mismatch here is one of the fastest ways to leak data or break consumers.