Strangler Fig migration
Replace a legacy capability in reversible slices.
The problem and the pattern
Place routing in front of the old system and direct a bounded booking capability to the new implementation. Compare behavior and migrate data ownership deliberately. Keep routing reversible until the new path is proven, then retire the replaced legacy slice.
Follow the flow
Make it concrete
This excerpt isolates the concept. Connect it to the booking API as you work through the exercise.
Route by capability
Legacy: existing booking reads
New: reservation creation for a selected tenant cohort
Observe → reconcile → expand → retire old pathTrade-offs
- Incremental replacement reduces all-or-nothing release risk.
- Temporary integration and dual-running costs are real.
- Define cutover and retirement criteria before adding the new slice.
When to avoid it
Avoid a strangler migration without a usable routing seam or an agreed data-ownership transition.
Your turn
Why can independent writes to old and new databases create a migration trap?
Reveal a worked answer
Either write can fail, producing divergent state with no authoritative owner. Choose one write owner, use a reliable replication or outbox path if necessary, and verify reconciliation before shifting readers.