Strangler Fig Pattern
The strangler fig pattern is a migration strategy where a proxy layer is placed in front of a legacy system, and individual routes are gradually redirected to new implementations. Over time the new system replaces the old one entirely without a high-risk big-bang rewrite.
Technical Architecture & Deep-Dive
Named by Martin Fowler after vines that slowly envelop a host tree, the pattern relies on an interception layer. Clients keep calling the same URLs while the proxy decides, route by route, whether the legacy backend or the new service handles each request.
Edge proxies make strangler migrations straightforward: routing rules change instantly worldwide, response mapping can keep legacy payload shapes for old clients, and traffic can shift gradually to validate the new implementation.
Key Architectural Benefits
Implement Strangler Fig Pattern at the Edge
Deploy lightweight API aggregation, edge caching, and secret injection in minutes without Docker containers or complex servers.
Frequently Asked Questions
Q:When should I use the strangler fig pattern?
Use it when a legacy API is too large or critical to rewrite at once, and you need to deliver improvements continuously while keeping existing clients working.
Related Architecture Concepts
A Reverse Proxy is an intermediate server that intercepts requests from client applications and forwards them to one or more backend origin servers. The reverse proxy terminates TLS, applies security filtering, caches responses, and returns the result to the client as if it originated from the proxy itself.
API versioning is the practice of managing changes to an API so existing clients keep working when the provider introduces breaking changes. Common strategies include version numbers in the URL path, custom headers, and date-based versions like those used by Stripe.
An API Gateway is a single entry point that sits between client applications and backend services. It routes requests, enforces authentication and rate limits, transforms payloads, and aggregates responses so clients talk to one stable endpoint instead of many internal APIs.