Communication

Strangler Fig Pattern

Description

A pattern for migrating a legacy system by gradually replacing specific functionalities with new applications and services. The new system wraps around the old one like a strangler fig tree.

Where to use

  • Monolith decomposition.
  • \n
  • Incremental migration.

Real World Example

An old E-commerce monolith exists. You build a new 'Review Service'. The API Gateway routes '/reviews' to the new service, while everything else still goes to the Monolith.

Code Example

# Code Concept for Strangler Fig Pattern\n# This pattern is architectural.\n\nclass Service:\n    def execute(self):\n        # Implementation logic\n        pass