Search⌘ K
AI Features

Strangler Fig Pattern

Explore the Strangler Fig pattern to safely migrate legacy monolithic systems into modern microservices incrementally. Understand how a routing facade manages traffic between old and new components, enabling rollback and controlled cutover. This lesson guides you through identifying bounded contexts, deploying routing layers, and shifting traffic gradually while ensuring observability and consistency for a reliable transition.

In the previous lesson, we explored how caching layers optimize data access in modern architectures. But migrating a legacy system to actually leverage those patterns demands more than ambition. It demands a safe, incremental strategy rather than a risky big-bang cutover.

Incremental update in Strangler Fig pattern
Incremental update in Strangler Fig pattern

The Strangler Fig pattern fills in that gap. Borrowed from a biological metaphor, it enables teams to decompose monolithic legacy systems into modern services one capability at a time, maintaining production availability throughout the entire transition.

Origin and concept of the pattern

The strangler fig tree in tropical forests germinates in the canopy of a host tree, sending roots downward that gradually envelop the host’s trunk. Over time, the fig assumes the structural role of the host, which eventually decomposes and disappears. The fig stands independently where the host once was.

This maps precisely to software migration. The legacy system is the host tree. New microservices or modules are the fig’s roots growing around it. A routing facadeAn intermediary layer, such as an API gateway or reverse proxy, that intercepts incoming requests and decides which backend system should handle them. acts as the growing canopy, directing traffic to whichever system currently owns each capability.

Martin Fowler coined three core phases for this pattern:

  1. Transform involves building the new component alongside the legacy system. ...