Strangler fig pattern

스트랭글러 전환

Move routes from an old system to a replacement incrementally.

···
html
<div class="scene"><div class="title">GRADUAL TRAFFIC MIGRATION</div><div class="split"><div id="legacy">LEGACY <b id="oldPct">80%</b></div><div id="modern">NEW <b id="newPct">20%</b></div></div><div class="row route"><div class="tile">ROUTER</div><span>→</span><div class="tile" id="route">catalog → new</div></div></div>
css
.scene{width:min(94vw,760px);height:min(86vh,320px);padding:clamp(10px,2.5vmin,18px);border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--fg);font:500 clamp(11px,1.3vw,16px)/1.25 "Pretendard Variable",Pretendard,-apple-system,sans-serif;display:flex;flex-direction:column;gap:clamp(7px,1.6vmin,12px);overflow:hidden}.scene *{box-sizing:border-box}.title{font-weight:750;color:var(--accent)}.muted{color:var(--muted)}.mono{font-family:ui-monospace,monospace}.row{display:flex;align-items:center;justify-content:center;gap:clamp(5px,1.4vmin,12px);flex:1;min-height:0}.tile{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:clamp(6px,1.6vmin,12px);text-align:center;min-width:0}.on{border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 12%,var(--surface))!important}.pulse{animation:pulse 1.6s infinite alternate}@keyframes pulse{to{border-color:var(--accent);transform:translateY(-3px)}}.split{display:flex;height:36%;min-height:42px;border-radius:8px;overflow:hidden;border:1px solid var(--line)}.split div{display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;transition:width .6s}.split #legacy{background:var(--line)}.split #modern{background:var(--accent);color:var(--bg)}.route{justify-content:flex-start}.route span{color:var(--accent)}
js
let n=1;function tick(){const newer=n*20,old=100-newer;document.getElementById('legacy').style.width=old+'%';document.getElementById('modern').style.width=newer+'%';document.getElementById('oldPct').textContent=old+'%';document.getElementById('newPct').textContent=newer+'%';document.getElementById('route').textContent=['catalog','profile','checkout','search'][n-1]+' → new';n=n%4+1}tick();setInterval(tick,1100)

The strangler fig pattern routes selected features to a replacement while remaining requests still reach the old system. The migration proceeds in small slices.

The demo shifts traffic from legacy to new service. Behavior parity and data synchronization must be checked before retiring each old path.

When to use

Use it to replace a large system feature by feature.

Open as page ↗