STRANGLER FIG MIGRATION•
B2B Logistics & Supply Chain Platform
•
7 min read

Zero-Downtime Strangler Fig Decomposition of an 8-Year Monolith

Safe decomposition of 450k lines of legacy code using the Strangler Fig pattern with Traefik and Vertical Slice Architecture. Deployment frequency grew from 1/month to 14/week with zero downtime.

Deployment frequency
14 per week1 per month
+56x
Regression detection time
4 minutes (CI/CD)3-5 days (manual)
Instant
Migration downtime
0.00 seconds24h+ risk
100% uptime
Strangler FigTraefikDDDVertical SliceDockerGitOps CI/CD

Business Context & Release Paralysis

A high-volume B2B logistics platform orchestrating thousands of daily supply chain operations faced soaring maintenance costs on an 8-year-old monolith exceeding 450,000 lines of code.

As billing logic and courier integrations grew increasingly complex, the legacy system started strangling business velocity:

The Board faced an executive crossroads: greenlight an 18-month "Big Bang Rewrite" with enormous budgetary risk, or find a safe, battle-tested engineering alternative.


Transitional Architecture: The Strangler Fig Pattern

We immediately dismissed the idea of rewriting everything from scratch. Instead, we implemented the Strangler Fig Pattern in tandem with Traefik Reverse Proxy and Vertical Slice Architecture.

[B2B Clients / API Consumers]
              │
              ▼
   [Traefik Reverse Proxy (Dynamic Routing)]
       │                              │
       │ (90% legacy traffic)         │ (Carved out domain slices)
       ▼                              ▼
  [8-Year Monolith]             [New Vertical Slices (DDD)]
    (Legacy Database)            - Invoicing Module
                                 - Dispatching Module
                                  (Dedicated PostgreSQL DB)
                                        ▲
                                        │ (Event Sync / RabbitMQ)
                                        ▼
                                [CDC / Debezium Outbox]

Core Architectural Directives:

  1. Zero Downtime: Operational shipment processing and corporate revenue generation were never interrupted for even a single minute.
  2. Incremental Domain Extraction: We applied Domain-Driven Design (DDD) and Event Storming to establish airtight Bounded Contexts.
  3. Transactional Outbox & Change Data Capture (CDC): Data synchronization between the legacy database and new microservices was decoupled via the Outbox Pattern and RabbitMQ, guaranteeing eventual consistency without shared database anti-patterns.

Step-by-Step Technical Execution

Phase 1: Edge Routing Layer (Traefik)

We placed Traefik at the network edge as an intelligent reverse proxy. Initially, 100% of inbound traffic was forwarded to the legacy monolith. As new domain slices matured, declarative routing rules redirected specific endpoints without requiring third-party API clients to change their integrations.

Phase 2: Extracting Invoicing to a Vertical Slice

The invoicing domain was chosen as the first candidate. Instead of traditional horizontal technical layers (Controllers -> Services -> Repositories), we adopted Vertical Slice Architecture: all business logic, validation, and data mutations for a specific command (e.g., GenerateInvoiceCommand) reside within a self-contained autonomous directory.

Phase 3: GitOps CI/CD Automation & OpenAPI Contracts

We enforced strict Consumer-Driven Contract Testing backed by OpenAPI schemas. Automated CI/CD pipeline execution in containerized Docker testbeds finished in under 4 minutes.


Measurable Business & Engineering Outcomes


Key Takeaway for Technology Leaders

Rewriting an entire system from scratch is the leading cause of enterprise IT budget catastrophes. The Strangler Fig pattern proves that even the most convoluted monolith can be decoupled safely, unlocking tangible business ROI in weeks rather than years.

PS
Lead Architect & Implementation Author
Przemysław Sobolewski

Principal System Architect & Fractional CTO. Designs and audits high-throughput distributed systems for enterprises across the EU and US.

Consult Architecture