advanced
Strangler fig
Move behavior out of a legacy system incrementally by routing one capability at a time through adapters and rollback-safe releases.
Gradually replace a legacy system by routing new or migrated capabilities to new implementations while the old system shrinks — like a fig tree strangling its host. Use facades, proxies, and feature flags to shift traffic capability by capability with rollback.
Trade-off: running two systems in parallel is expensive but safer than big-bang rewrite.
On interviews: migrate authentication from monolith to new service without downtime; define routing rules and success metrics.
Common pitfalls: unmaintained strangler layer forever; migrating data without sync verification; cutting over without observability parity.
Checklist:
- Route by feature or URL with measurable traffic split.
- Keep adapters thin and testable.
- Verify data parity between old and new paths.
- Decommission legacy modules with explicit milestones.