☁️ Cloud Architecture Patterns

← Back to Gallery
🌿

Strangler Fig Pattern

Definition

The Strangler Fig Pattern enables gradual migration from a legacy system to a new architecture by incrementally replacing specific pieces of functionality with new services. Named after the strangler fig tree that gradually replaces its host, this pattern allows you to modernize systems without a risky big-bang rewrite.

When to Use It

  • Migrating from monolithic to microservices architecture
  • Modernizing legacy applications
  • You want to minimize risk during migration
  • Need to maintain business continuity
  • Gradual team learning of new architecture
  • Budget constraints prevent complete rewrite

Pros & Cons

βœ“ Pros

  • Low-risk incremental migration
  • Business continuity maintained
  • Faster time to value
  • Easy rollback if issues occur
  • Gradual team skill development
  • Parallel operation of old and new

βœ— Cons

  • Longer overall migration timeline
  • Maintaining both systems simultaneously
  • Complex routing logic needed
  • Data synchronization challenges
  • Technical debt in transition period
  • Requires discipline to complete

Architecture Diagram

Phase 1: Initial State (All traffic to legacy)
───────────────────────────────────────────────

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  Client  β”‚
        β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚    Facade    β”‚
     β”‚  (Routing)   β”‚
     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚ 100%
            β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Legacy Monolith   β”‚
    β”‚                    β”‚
    β”‚  β€’ Auth            β”‚
    β”‚  β€’ Products        β”‚
    β”‚  β€’ Orders          β”‚
    β”‚  β€’ Payments        β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


Phase 2: Partial Migration (Mixed routing)
───────────────────────────────────────────

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  Client  β”‚
        β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚    Facade    β”‚
     β”‚  (Routing)   β”‚
     β””β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”˜
         β”‚ 30%  β”‚ 70%
         β–Ό      β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  Auth   β”‚ β”‚ Legacy System  β”‚
   β”‚ Service β”‚ β”‚                β”‚
   β”‚         β”‚ β”‚ β€’ Products     β”‚
   β”‚  (New)  β”‚ β”‚ β€’ Orders       β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β€’ Payments     β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


Phase 3: Advanced Migration
────────────────────────────

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  Client  β”‚
        β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚    Facade    β”‚
     β”‚  (Routing)   β”‚
     β””β”€β”¬β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”¬β”€β”€β”˜
       β”‚  β”‚   β”‚  β”‚
    30%β”‚20%β”‚ 30%β”‚20%
       β–Ό  β–Ό   β–Ό  β–Ό
   β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚Authβ”‚β”‚Prodβ”‚β”‚Ordrβ”‚β”‚  Legacy    β”‚
   β”‚Svc β”‚β”‚Svc β”‚β”‚Svc β”‚β”‚            β”‚
   β”‚    β”‚β”‚    β”‚β”‚    β”‚β”‚ β€’ Payments β”‚
   β”‚(Newβ”‚(Newβ”‚β”‚(Newβ”‚β”‚            β”‚
   β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


Phase 4: Complete Migration
────────────────────────────

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚  Client  β”‚
        β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚  API Gateway β”‚
     β””β”€β”¬β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”¬β”€β”€β”˜
       β”‚  β”‚   β”‚  β”‚
       β–Ό  β–Ό   β–Ό  β–Ό
   β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”
   β”‚Authβ”‚β”‚Prodβ”‚β”‚Ordrβ”‚β”‚ Pay β”‚
   β”‚Svc β”‚β”‚Svc β”‚β”‚Svc β”‚β”‚ Svc β”‚
   β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”˜

   [Legacy System Decommissioned]

Migration Steps:
1. Add routing facade
2. Identify service to extract
3. Build new service
4. Route traffic gradually
5. Verify functionality
6. Decommission legacy component
7. Repeat for next component