Architecture Intermediate
Strangler Fig Pattern — Migrating from a Monolith¶
Strangler FigMigrationMonolith 3 min read
Gradual migration from monolith to microservices. A safe, incremental approach.
Principle¶
Named after the strangler fig tree that grows around its host. You gradually replace parts of the monolith with new services.
Steps¶
- Build a proxy/facade in front of the monolith
- Select a feature to extract (start with a simple one)
- Implement the new service
- Redirect traffic
- Remove the old code
server {
listen 80;
# Migrated
location /api/orders { proxy_pass http://new-order-service:8080; }
# Legacy
location / { proxy_pass http://legacy-monolith:3000; }
}
Tips¶
- Start at the edges — features with the fewest dependencies
- Anti-Corruption Layer between old and new
- Feature flags for traffic switching
- Migration takes months to years — don’t rush
Summary¶
Strangler Fig is the safest path out of a monolith. No big bang, just gradual displacement of old code.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.