"매 incremental 의 always wins". 매 architecture refactor 의 default approach 의 Martin Fowler 의 Strangler Fig (2004) — 매 old system 의 around 의 new system 의 gradual 의 grow. 매 big-bang rewrite 의 historically failure rate >70% (Ousterhout, Brooks). 매 2026 의 typical pattern: 매 monolith → modular monolith → selective service extraction.
매 핵심
매 refactor strategies
Strangler Fig: 매 facade 의 routing — 매 traffic 의 incrementally 의 new system 의 redirect.
Branch by Abstraction: 매 abstraction layer 의 introduce — 매 dual 의 implementation — 매 old 의 remove.
Parallel Run: 매 old + new 의 동시 실행 — 매 output 의 compare.
Big Bang Rewrite: 매 last resort — 매 only 매 system 의 small + scope 의 frozen 의 가능.
매 refactor 의 prerequisite
Test coverage: 매 characterization tests (Feathers) 의 minimum.
Observability: 매 metrics + traces 의 before/after diff.
Feature flag: 매 reversibility 의 prerequisite.
ADR: 매 decision rationale 의 documented.
매 응용
Monolith → modular monolith — 매 module boundary 의 enforce (ArchUnit).
Service extraction — 매 bounded context 의 따라.
Database split — 매 most expensive — 매 last 의 do.
Framework upgrade — 매 incremental migration.
💻 패턴
Strangler Fig — Nginx routing facade
upstreamlegacy{serverlegacy.internal:8080;}upstreamnew{servernew.internal:8080;}server{listen443ssl;# New endpoints — gradual rollout
location/api/v2/orders{proxy_passhttp://new;}location/api/v2/users{proxy_passhttp://new;}# Everything else still legacy
location/{proxy_passhttp://legacy;}}
asyncfunctionchargeShadow(order: Order):Promise<Receipt>{const[primary,shadow]=awaitPromise.allSettled([legacy.charge(order),newImpl.charge(order)// never persists, just observes
]);if(shadow.status==='fulfilled'&&primary.status==='fulfilled'){diff.record('charge',primary.value,shadow.value);}returnprimary.status==='fulfilled'?primary.value : Promise.reject(primary.reason);}
# 1. Codify module boundary first (ArchUnit)# 2. Replace direct calls with in-process interface# 3. Add feature flag: in-process vs HTTP/gRPC# 4. Deploy as separate process behind flag# 5. Remove in-process path
언제: 매 legacy code → modern equivalent translation, 매 codemod plan generation, 매 ADR draft.
언제 X: 매 production cutover decision — 매 human + traffic data 의 필수.
❌ 안티패턴
Big bang rewrite: 매 70%+ failure rate — 매 last resort.
Refactor without tests: 매 silent regression 의 guarantee.
No flag, no rollback: 매 forward-only deploy — 매 incident magnification.
Premature service extraction: 매 distributed monolith 의 worst-of-both.
Stop midway: 매 두 system 의 forever maintain — 매 cost 의 doubled.
🧪 검증 / 중복
Verified (Fowler — StranglerFigApplication; Feathers — Working Effectively with Legacy Code; Newman — Monolith to Microservices).