Tutorials Design Patterns in C#
Strangler Fig Pattern — Complete Guide
Strangler Fig Pattern — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of Design Patterns in C# on Toolliyo Academy.
On this page
Design Patterns in C# · Lesson 52 of 69
Strangler Fig Pattern
GoF Core ✓ → Enterprise ✓ → Cloud & Craft
Cloud & Craft · 3 — Microservices & interviews · ~6 min · Module 6: Microservices & Cloud Patterns
What is this?
Strangler Fig replaces a legacy system piece by piece — route new paths to new services while old paths stay on the monolith.
Why should you care?
ShopNest cannot rewrite the whole monolith in one big-bang release.
See it live — copy this example
Paste into a C# console or class library project and run dotnet run.
// Gateway routes
Console.WriteLine("/catalog/** -> new CatalogService");
Console.WriteLine("/checkout/** -> legacy Monolith");
Console.WriteLine("migrate more routes over time; delete legacy when idle");
What happened?
- Intercept at the edge, grow the new system around the old, then remove dead legacy.
- Measure traffic per route before cutting over.
Practice next
- Pick one ShopNest bounded context to extract.
- Route its URLs to the new service.
- Compare responses in shadow mode if needed.
- List next three routes to migrate.
- Add metrics per routed path.
Remember
Incremental replacement. Route-based cutover. Retire legacy deliberately.
ShopNest catalog extraction
Catalog routes move first; checkout stays legacy temporarily.
Outcome: Risk stays small; value ships early.
Interview prep for this lesson
Practice these questions aloud after reading—each links to a full structured answer.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!