Originally published at AEITCH Insights by AEITCH Systems Architecture Pod.
Executive Summary
Big-bang rewrites almost always exceed schedules and introduce regressions. The Strangler Fig pattern allows teams to modernize critical enterprise monoliths incrementally by intercepting traffic at an API gateway and extracting domain boundaries one bounded context at a time.
- Never rewrite a monolith from scratch in a separate branch while maintaining the old system; parallel rewrites diverge rapidly.
- Deploy an intelligent edge gateway (Envoy/Traefik) to route traffic transparently between legacy endpoints and newly extracted services.
- Use Change Data Capture (CDC) with Debezium to replicate database state asynchronously without introducing distributed transactions.
Every successful legacy system eventually becomes technical debt. Decades of business rules, undocumented edge cases, and tightly coupled database schemas make executives terrified of touching their core platforms. However, the solution is never a high-risk "big bang" rewrite. The proven industry standard is the Strangler Fig migration.
1. Why Big-Bang Rewrites Fail in Enterprise Environments
In a big-bang rewrite, a separate engineering team is tasked with rebuilding the entire system from scratch. Meanwhile, the legacy team continues adding features and fixing bugs to support current customers.
By the time the new system is ready for testing 18 months later, the business requirements have evolved, the two systems have diverged, and cutover becomes a terrifying all-or-nothing roll of the dice. Most big-bang rewrites are abandoned after millions in sunk expenditure.
2. The Strangler Fig Pattern Mechanics
Named by Martin Fowler after the Australian strangler fig vine that germinates in the branches of a host tree and slowly envelops it, this pattern gradually replaces old functionality until the legacy system can be safely decommissioned.
Step 1: Intercept all incoming traffic at an API Gateway (e.g. Envoy, Kong, or Cloudflare Workers).
Step 2: Identify the most isolated bounded context in the domain model (e.g. Notification dispatch or Billing ingestion).
Step 3: Build the new microservice using modern frameworks and databases.
Step 4: Shift 1% of live traffic to the new service using Canary routing. Verify logs and error budgets.
Step 5: Increase traffic to 100%, deprecate the legacy code path, and repeat for the next domain context.
3. Data Synchronization via Change Data Capture (CDC)
The hardest part of service extraction is data sharing. Microservices should never query the legacy monolith database directly. Instead, deploy Change Data Capture (CDC) via Debezium and Kafka to stream database commit log mutations into the new service database in real time.
Debezium Kafka Connect configuration streaming Postgres WAL logs into event streams
{
"name": "legacy-monolith-cdc-connector",
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"tasks.max": "1",
"plugin.name": "pgoutput",
"database.hostname": "monolith-db.internal",
"database.port": "5432",
"database.user": "cdc_replicator",
"database.password": "${file:/secrets/db:cdc_pass}",
"database.dbname": "production_monolith",
"database.server.name": "monolith",
"table.include.list": "public.orders,public.order_items",
"tombstones.on.delete": "false"
}
}
References & Further Reading
- Martin Fowler — StranglerFigApplication — Foundational architectural essay defining incremental application modernization.
Explore more from AEITCH: Read the full interactive blueprint on AEITCH Insights or explore our Custom Software & Systems engineering practice.
Top comments (0)