Problem: You need to make a breaking change, but can’t update all call sites...


Problem: You need to make a breaking change, but can’t update all call sites at once.

Solution: Expand, migrate, contract.

1. Expand. Add the new API, but keep the old one working too.

2. Migrate. Update calls to use the new API, over time.

3. Contract. When no one calls the old API, delete it.

This pattern is useful for database schema changes too:

1. Add the new column
2. Update all call sites to read the new column
3. Remove the old column

It requires multiple releases, but it’s safe, and supports an incremental path toward a breaking https://martinfowler.com/bliki/ParallelChange.html…

View original on X