📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Microservices Strangler Fig Pattern

Strangler Fig Pattern

5 min read
Extract services from a monolith incrementally via API Gateway routing — the safest migration strategy.

Strangler Fig Pattern

Extract microservices from a monolith incrementally — never rewrite everything at once.

# Step 1: Identify bounded context to extract
# Step 2: Build new service alongside monolith
# Step 3: Route traffic via API Gateway
# Step 4: Deprecate monolith code for that feature
# Step 5: Repeat

# Nginx routing during migration
# During: payment -> new service
location /api/payments {
    proxy_pass http://payment-service:3001;
}
# Rest stays in monolith
location / {
    proxy_pass http://monolith:3000;
}

# After: payment fully extracted
# Remove payment code from monolith