Logo
Grokking Microservices Design Patterns
Ask Author
Back to course home

0% completed

The Strangler Pattern: A Solution

The implementation of the Strangler Pattern begins by identifying a single functionality of the legacy system that can be rebuilt and redirected to the new system.

Once a functionality is identified, it's duplicated in the new system, and traffic is rerouted to the new implementation using a Facade interface. This interface is the gatekeeper, directing incoming requests either to the new system or to the old one. Over time, more and more functionality is migrated to the new system, and traffic to the old system decreases until it's finally phased out.

Steps:

  1. Identify Entry Points: Choose parts of your legacy system you want to replace and build new services to replace old functionalities.
  2. Route Traffic: Use a router/proxy to redirect traffic either to the old system or new service, based on what's been migrated.
  3. Incrementally Build & Replace: Develop the new microservices and slowly replace old functionalities.
  4. Retire the Old: Once all functionalities have been taken over by the new system, safely retire the old system.
Image
Strangler Fig Pattern

This progressive approach minimizes risk and allows for continuous delivery and integration, making it possible to replace the legacy system without disrupting normal business operations.

Mark as Completed