Rewrite Without the Big Bang
A full rewrite of a legacy API is risky and slow to ship. The strangler fig pattern, named after a vine that grows around a tree, replaces the old system piece by piece while it keeps running. A routing layer sits in front and gradually sends traffic to new endpoints.
How It Works
- Put a proxy or facade in front of the legacy API.
- Build a new endpoint and route only that path to it.
- Migrate one route at a time, verifying each before the next.
- When the last route moves, retire the legacy system.
Why It Is Safer
Each step is small and reversible. If a new endpoint misbehaves, the proxy routes back to the legacy path. Clients see one stable address the whole time because the proxy hides the migration.
Pitfalls
Watch for shared data between old and new during the overlap, and set a deadline so the half migrated state does not linger forever.
Key idea
The strangler fig replaces a legacy API incrementally behind a routing proxy, migrating one route at a time so each step stays small, reversible, and invisible to clients.