Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Strangler Fig
HLD

Strangler Fig

Migrating systems gradually — the new growth wraps the old until the old trunk fades away.

The Big-Bang Trap

 rewrite-the-monolith projects: famously lethal.

 18-month rewrites meet reality:
 - business keeps changing DURING the rewrite
 - feature freeze kills the business's patience
 - the old system keeps evolving → moving target
 - big-bang cutover = one enormous untestable bet

 THE STRANGLER FIG (Fowler, from the vine that grows around
 a tree until the tree is gone):
 route traffic through a facade; migrate ENDPOINT BY ENDPOINT;
 old system shrinks incrementally until it's removable.

The Mechanics

 STEP 1: put a FACADE in front of everything:

 [clients]──►[facade/router]──►[legacy monolith]  (100%)

 STEP 2: pick ONE capability; build it as a new service;
         route its paths to it:

 [facade]──/orders/*──────►[orders-svc: NEW]
          ──everything else─►[legacy]

 STEP 3: repeat per capability. legacy share shrinks:

 [facade]──/orders,/inventory,/users──►[new services]
          ──/reports──►[legacy: shrinking...]

 STEP 4: last path migrates; delete the trunk.

What Makes It Work

 □ ROUTING IS REVERSIBLE: new service misbehaves? flip back
   instantly. risk per step = tiny and bounded ✓
 □ DATA COEXISTENCE plan per migration:
     - shared-read phase: new service reads legacy DB
       (temporary, read-only — the sanctioned exception!)
     - then data moves; legacy reads via events/API
     - write-ownership flips LAST, behind the router
 □ INCREMENTAL VALUE: every migrated endpoint ships real
   improvements NOW; no 18-month faith-based program
 □ PARITY TESTING: shadow-traffic comparisons before each
   flip (same request → same response?) catches drift

 anti-goals to name out loud:
 ✗ "rewrite while also building the roadmap" without
   capacity math — strangler still needs TEAM BUDGET
 ✗ migrating the hardest domain first for glory —
   start with edges, learn the machinery.

The Hard Part: Data

PhaseOrders data livesWritesReads
Pre-migrationlegacy DBlegacylegacy
Dual-read pilotbothlegacycompare both
Ownership flipNEW db ← migratednew svc onlynew (+events)
Legacy retirementgone from legacyn/an/a
 the ownership-flip moment is the risky beat:
 freeze window or CDC-synced dual-write with verification,
 THEN cut. reversibility shrinks here — rehearse it.

Interview Framing

“We must modernize our 12-year-old monolith but can’t stop shipping” scored shape: reject big-bang explicitly with reasons, strangler mechanics drawn (facade → incremental routing), data-coexistence phases tabled, reversibility emphasized as THE property, sequencing advice (edges first), parity/shadow testing named. Migration questions grade RISK ARCHITECTURE — answers that eliminate the possibility of total failure outrank answers that promise speed.

My Private Notes

Notes are auto-saved locally to this device.