Strangler Fig Pattern
An incremental modernization method that routes selected capabilities to new implementations until the legacy system can be reduced or retired safely.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/strangler-fig-pattern/
01What it means
The Strangler Fig Pattern replaces a legacy system gradually rather than through a single rewrite. Teams establish a seam—such as a proxy, routing layer, facade, event feed, or data boundary—then implement one capability outside the old system and redirect relevant traffic to it. Repeating the cycle lets the new system grow around the old one.[1][2][3]
- 01Map legacy boundariesUsers, dependencies, data, risks
- 02Introduce seamProxy, facade, event, or data boundary
- 03Build bounded sliceReplacement outside legacy internals
- 04Redirect graduallyCompare outcomes and retain fallback
- 05Remove replaced partRepeat until remaining value is gone
Each slice needs observability, data handling, outcome comparison, and a tested fallback before legacy removal.
02Why it matters
Large rewrites delay value and must chase ongoing business changes while recreating years of hidden behavior. Incremental replacement can deliver improvements earlier, limit each migration step's blast radius, and produce evidence before the next investment. It also allows the existing system to keep serving users while risky or high-value areas move deliberately.
03When to use it
Use the pattern when a valuable legacy system must remain operational and can be divided through workable seams. Prioritize capabilities with clear boundaries, business value, or painful constraints. It is less suitable when no interception point exists, data cannot be separated safely, or a short-lived system can be replaced more cheaply in one step.
04How it works
- Map users, dependencies, data flows, operational risks, and candidate capability boundaries in the legacy system.
- Introduce a controllable seam that can direct requests, events, or work to either old or new behavior.
- Select a bounded slice and define parity, improvement, data, security, and rollback expectations.
- Build the replacement slice with observability and migration mechanisms, avoiding unnecessary imitation of legacy internals.
- Route traffic gradually, compare outcomes, resolve discrepancies, and retain a tested fallback while confidence grows.
- Remove replaced code and dependencies, then repeat until remaining legacy value no longer justifies operation.
05A practical example
An insurer places a facade in front of a policy administration system. It first moves read-only policy documents to a new service, then renewal quotes, using cohort routing and reconciliation reports. Each successful slice removes calls and jobs from the legacy application until only archival access remains and the old runtime can be retired.
06Where it breaks
During migration, the organization operates old and new paths together, increasing cost and cognitive load. Shared databases, duplicated rules, identity, and cross-system transactions can undermine separation. Without explicit retirement milestones, the facade may become permanent middleware and the legacy system may survive indefinitely with even more integrations attached.
Common mistakes
- Beginning with the most entangled capability instead of proving the migration mechanism on a bounded slice.
- Copying legacy structure and defects into the replacement without reconsidering the domain boundary.
- Running dual systems without reconciliation, observability, rollback, or clear ownership.
- Adding new paths but never deleting replaced code, data flows, infrastructure, or contracts.
07Sources
- Strangler FigMartin Fowler · Original pattern articleStrangler Fig
- The Strangler Fig PatternAWS Prescriptive Guidance · Institutional implementation guideThe Strangler Fig Pattern
- Cloud Design Patterns, Architectures, and ImplementationsAWS Prescriptive Guidance · Institutional pattern catalogCloud Design Patterns, Architectures, and Implementations