Strangler migration
Strangler migration replaces selected capabilities of an existing system in controlled steps. Routing, data responsibility and return determine how long old and new implementation work together.
- Small shareYou are releasing only one ability and only gradually.
- Measurement pointsLimit values decide on the next step.
- Return routeYou can switch back at any time.
Context
Why this is important
A complete replacement at once bundles risk and leaves no way back. Gradual detachment keeps old and new paths side by side and decides on the basis of measured values. Schema and data deals with data migration.
This building block deals with incremental detachment. Data migration plans schema and data transitions; deployment controls version deployment.
At a glance · Gradual detachment over a facade
Invoice search gradually redirect
Variant: The shop only directs the bill search to a new service. Ordering and payment remain in the modular monolith; routing can be deferred for search.
This is how you read the picture
- Small share You increase the share of 0 over 5 and 25 on 100 %.
- Measurement points Hit rate and response time are opposed to 97 % and 400 MS is tested.
- Return route Everyone walks with a switch 2.000 Search again in the monolith.
Benefits & limitations
Helps if:
- Self-contained business capabilities can be migrated separately from the rest of the existing system.
- Step-by-step conversion limits migration risks during continuous product development.
Boundaries
- Unclear write ownership creates conflicting data; each migrated slice needs an authoritative writer. See Data migration.
- Growing routing logic becomes a permanent bottleneck; every legacy path needs an owner and retirement criteria.
- The effort pays off for invoice search; routing provides little benefit for tightly coupled order and payment logic.
In practice
- Choose the capability and boundary. Identify a complete business function with bounded inputs, outputs and data effects. Check whether it can be tested and observed independently. This defines a slice with clear takeover responsibility.
- Plan routing and data ownership. Define which path receives requests, where changes are authoritatively stored and how failures propagate back. Document compatibility and switchover conditions. This keeps the old and new paths manageable during coexistence.
- Verify takeover and remove the old path. Measure quality and usage, test rollback and define retirement criteria before migration. Remove routing and legacy components after successful takeover. This demonstrably reduces transitional complexity.
Read the detailed explanation
A Strangler migration routes selected functions through a shared entry point to a new or existing implementation. Each slice needs a clear business boundary, data ownership and a verifiable operational state. The approach connects the transition to Data migration and uses suitable Module boundaries for separation.
Old and new paths coexist temporarily. Routing, synchronisation, monitoring and rollback add architectural work. Once the takeover is verified, the old path is removed; routing remains transitional and the new capability supports production operation. Small slices provide feedback from real use; choose them for business independence and limited risk. Parallel operation needs clear write ownership and coordination of changed data. Each migrated capability should have a defined point for rollback or retirement.
Martin Fowler named the pattern after the strangler fig, which gradually grows around a tree.
Check your understanding
Test yourself in three stages
ReadingCheck in the picture
At what proportion does the hit rate fall below the limit, and what do you do?
View the solution with justification
In case of: 5 % (96 % at least 97 %). Keep the proportion small or reset, clarify the deviation, then only increase.
ApplyingTransferred to a new situation
The new search service delivers fewer hits on the first requests than the old path. What are you doing?
View the solution with justification
Keep the portion small or reset the routing, investigate the deviation and only then redirect the next portion. The monolith remains the leader.
EvaluateWeighing an alternative
Instead of switching in steps, you could completely replace the bill search overnight. What speaks in favour, what speaks against?
View the solution with justification
A complete change is faster and knows no double paths. But he has no comparison values and no quick way back, if the new service hits worse.
Explore further
These building blocks continue the thoughts of this page.
References
- Martin Fowler – Strangler Fig Application (opens in new tab)Describes the gradual replacement of existing systems with new functionality.
- Microsoft - Strangler Fig pattern (opens in new tab)Shows routing, transition states and prerequisites for incremental detachment.
- AWS - Strangler fig pattern (opens in new tab)Combines gradual migration with interfaces and operational transition.