The Strangler Fig Migration: From Monolith to 700+ Microservices
Why / The Problem
The DVD-era system was a vertically-scaled monolith on one relational database. A 2008 database corruption halted DVD shipping for several days and exposed the real problem: that one datastore was both a single point of failure and a hard ceiling on scale.
Bigger databases and better backups treat the symptom. The constraint is architectural: capabilities that share a process, a database and a deploy share fate, and can't be scaled or failure-isolated independently however well they're run. The other obvious fix — freeze the monolith, rewrite, cut over once — fails in its own well-known way:
| Big-bang rewrite | Strangler fig (incremental replacement) |
|---|---|
| Nothing ships until the whole thing is done | Each piece ships and earns trust on its own timeline |
| Old and new drift apart while the monolith keeps changing | Both run on the same live traffic, so drift shows up immediately |
| One massive, high-blast-radius cutover | No cutover moment — the last piece is a small, low-drama step |
| A gap found late means redoing large parts | A gap shows up on a small slice of one endpoint, cheap to fix |
| Rollback = revert a whole system | Rollback = turn a routing weight back down, in seconds |
How It Works
The migration ran roughly 2008 through early 2016: compute moved to AWS, data to horizontally-scalable stores (notably Cassandra), and the monolith was split into independently deployable services.
- Rebuild one capability (say, one API endpoint) as a service with its own datastore. Owning the data is what breaks shared fate; a service still reading the monolith's database has only changed how it deploys.
- A gateway in front of both shifts traffic over gradually — a small percentage first, or shadow mode: the service gets a copy of real traffic and its responses are compared with the monolith's, but never served.
- Once it matches or beats the monolith on production traffic, move the full weight across and delete the old code path — an undeleted path is a second implementation that drifts and eventually gets hit by accident.
- Repeat for years. Monolith and services side by side wasn't a transition state; it was the normal operating condition.
Zuul, Netflix's edge gateway, made step 2 practical: every client request passes through it first, so the old-vs-new weight can shift per request without the client knowing. Its filter model (pre-routing, routing, post-routing, error) makes shadowing, canaries and stress tests a matter of adding a filter. Zuul isn't the first hop — global DNS steering and AWS ELB pick which region and Zuul cluster a client reaches, and that outer layer is what the Regional failover part’s failover manipulates.
What was strangled last? People usually say "the front door" — but there are two things at the front, and only one of them was replaced:
| Zuul — the doorman | api.netflix.com — the API app | |
|---|---|---|
| What it does | Every request hits it first. It looks at the URL and forwards the request to the right cluster — a group of servers all running the same program (e.g. /api/… goes to the API app's servers). That's all. | Sits right behind Zuul. Calls many backend services and stitches their answers into one response shaped for your TV or phone. |
| What happened to it | Never replaced — Zuul was the tool doing the replacing. It was only upgraded in place (Zuul 1 → Zuul 2, ~2018, the What aged part). | Replaced last — broken into one small backend per device type (a "backend-for-frontend", written in Node.js), and later a single GraphQL layer. |
Why last? Every client app talked to the API app, so a mistake there would break Netflix for everyone. So Netflix moved the low-risk pieces first, built up confidence that the method worked, and only then tackled the riskiest one.
Why not put a router in the middle too? One homepage load is ~700 service-to-service calls, so it would carry 700× the edge's volume, and every call would fail the moment it hiccupped — the exact single point of failure the decomposition was meant to remove. Eureka avoids this because the registry is not in the request path:
| If a central east-west router died | If Eureka (the phone book) dies | |
|---|---|---|
| Immediate effect | Total outage — nothing reaches anything | Nothing; callers keep using cached lists |
| What's lost | All east-west traffic | Only learning about new instances |
| Degradation shape | Cliff | Slow staleness over minutes |
How often the phone book refreshes — and how stale it gets
No service calls Eureka in its own code. The Eureka client library built into every service (Zuul included) does it on a timer:
- At startup, the service downloads the full registry once, before it starts taking traffic.
- Every 30s after that, it asks only for a delta — the instances added, removed or changed recently — and merges it into its local copy.
- As a safety check, each delta carries a hash of the whole registry. If the merged copy doesn't match, the client throws it away and downloads the full registry again.
- In the other direction, each instance sends a heartbeat every 30s. If Eureka hears nothing for 90s, that instance is removed.
The staleness adds up because three caches sit in a row, each refreshed every ~30s: the Eureka server's own response cache, the client's local copy, and the server list inside Ribbon (the caller's load balancer).
| Event | How long until callers notice |
|---|---|
| New instance starts | Up to ~90s before it gets traffic (three 30s caches) |
| Instance shuts down cleanly | Fast — it tells Eureka "I'm leaving" before it stops |
| Instance crashes | Several minutes — 90s to expire, plus the same three caches; callers keep trying it meanwhile |
Netflix accepted this on purpose. Every call has a timeout and a retry (the Hystrix part’s Hystrix), so a caller that picks a dead instance fails fast and tries another. Eureka chooses availability over consistency: a slightly stale phone book is fine; a registry that stops answering is not.
In one line: thin at the edge, no middle at all. And the cost of the design: every in-process function call became a network call to a service that deploys and fails on its own. A 500–700+ call fan-out per homepage load follows directly. That single fact is why the Hystrix, Chaos engineering, and EVCache parts have to exist at all.
Who actually does the fan-out — the shape behind the ~700 calls
The usual picture is Zuul → a BFF → hundreds of endpoints → one merged response. The shape is right, but the scale is wrong and a layer is missing, and the Hystrix and One press of Play parts depend on both corrections.
| The shorthand says | What is actually there | Why it matters |
|---|---|---|
| "a BFF" | One BFF per device family. Zuul's one decision is which of these origin clusters gets the request. | A TV and a phone want different payloads. One shared aggregator either serves the union (slow for all) or grows per-device branches (a monolith again). |
| "calls hundreds of endpoints" | Dozens, directly — personalization, viewing history, artwork, entitlements, metadata and a few more. 700+ is the size of the service estate; no request walks all of it. | The Hystrix part’s bulkheads fit "dozens per request": enough for one slow dependency to eat the thread pool, few enough that per-dependency pools are affordable. |
| "and combines them" | The fan-out recurses. Personalization calls ranking and A/B allocation; viewing history reads Cassandra; artwork asks the bandit — all east-west, via cached Eureka lists. | ~700 is the total of this tree, not any one fan-out — so no single service is "the" bottleneck and there's no one place a router could go. |
Assembly is where optional vs. required is decided, per dependency, by the BFF — not by Zuul or the services. A failed personalization call becomes a fallback row and the page still renders; a failed entitlement or playback-authorization call fails the request. The One press of Play part lists which dependencies were made optional and the two that couldn't be.
"Cassandra is multi-master and globally replicated" is shorthand for two separate facts — any replica may accept a write, and each keyspace declares which regions hold a full copy. Together they're why the Regional failover part’s failover needs no database promotion, and their price is last-write-wins conflicts that every service above has to design around. ◆ Side read: what "multi-master, globally replicated" actually means →
The Invariants
- Guarantees: Production was always a working mix of monolith and services — never a multi-year "in transition" state — and each strangled piece was validated on live traffic before the old path was removed.
- Does not guarantee: That decomposition alone improves reliability. It trades one failure mode (a shared-fate single point of failure) for another (a fan-out where any of hundreds of dependencies can be down right now). Whether that's a net win depends on the Hystrix, EVCache, and Regional failover parts containing the new one.