Home / Insights / Architecture and Modernization

Architecture and Modernization

Modernising a Monolith with the Strangler Fig Pattern: Seams, Sequencing and the Cost of Running Two Systems

Rewriting a legacy system from scratch is tempting and usually riskier than it looks. The strangler fig pattern replaces a system piece by piece instead. This guide covers how to find seams, sequence the work, handle shared data and budget for the period when old and new run side by side.

TopicsArchitecture and ModernizationSoftware Costs and Budgets

Key takeaways

  • The strangler fig approach builds new capability alongside the legacy system and moves behaviour across in small steps, so value and risk reduction arrive early.
  • Start by defining outcomes, then find seams: points where requests, data or business capabilities can be intercepted and redirected.
  • Choose the first slice for learning and low risk, not for maximum impact. It proves the routing, deployment and data approach.
  • Shared databases are the hardest part. Plan data ownership, synchronisation and the point at which the old tables are retired.
  • Budget explicitly for transitional architecture and for running two systems; it is temporary, but it is real cost.

Many organisations run a core system that has grown for years: an order management platform, a booking engine, an internal ERP extension. It works, but changes are slow, the original developers have moved on and the technology is ageing. The obvious answer is a rewrite. The trouble is that rewrites take longer than planned, users need new features in the meantime, and the new system must replicate years of behaviour, some of which nobody wants any more.

The strangler fig pattern, named by Martin Fowler after vines that gradually grow around and replace a host tree, offers an incremental alternative. This article explains how to apply it in practice. If you are still deciding the target architecture, our comparison of MACH and modular monoliths is a useful companion, and for understanding an undocumented system first, see using AI to reverse-engineer legacy applications.

Rewrite or incremental replacement?

FactorBig-bang rewriteStrangler fig replacement
When value arrivesAt the end, after cutoverProgressively, as each slice goes live
Risk profileConcentrated at cutoverSpread across many small releases
Feature work during the projectOften frozen or duplicatedContinues, increasingly in the new system
Unwanted legacy behaviourOften replicated by accidentCan be dropped slice by slice
Extra costParallel build with no return until launchTransitional code and running two systems
Ability to stopStopping midway leaves nothing usableCan pause with a working, partly modernised system

A rewrite can still be right for small systems, systems with very few integrations, or where the legacy platform cannot be intercepted at all. For most business-critical systems, incremental replacement is the safer default.

Define outcomes, then find the seams

Start with what modernisation is for: faster delivery of a particular area, lower hosting cost, removal of an unsupported runtime, or the ability to add capabilities such as AI features or a mobile app. Outcomes decide which parts to move first.

A seam is a place where you can split behaviour so a component can be replaced independently. Common seams:

  • HTTP routing: a reverse proxy or API gateway in front of the legacy application routes specific paths to new services.
  • User interface: a new front end takes over particular screens or journeys while others still render from the old system.
  • Events or messages: the legacy system publishes events (directly or via change data capture) that new components consume.
  • Batch and file interfaces: nightly imports or exports that can be re-implemented in isolation.
  • Business capability: a cohesive area such as pricing, notifications or reporting with relatively clear inputs and outputs.

Map these seams on a container-level diagram. The result shows which capabilities can be intercepted easily and which are tangled together.

Choosing the first slice and sequencing the rest

The first slice proves the approach: routing, deployment pipeline, monitoring, data synchronisation and team workflow. Choose it for learning value and manageable risk. Good first candidates:

  • A read-only capability, such as a reporting page or a customer-facing status view
  • A self-contained function with clear inputs and outputs, such as notifications or document generation
  • A new feature that would otherwise be built in the legacy system

Then sequence remaining slices using a simple scoring of business value, technical risk, dependency on other slices and data entanglement. Capabilities that share many tables with the rest of the system usually come later, once the data approach is proven.

An illustrative sequence for an order management system

  1. New customer-facing order tracking page reading from a replicated view
  2. Notifications service consuming order events
  3. Pricing and promotions moved behind a new API, called by the legacy checkout
  4. New checkout flow routed for one sales channel, then all channels
  5. Order write path moved; legacy order tables retired

The hard part: shared data

Routing requests is relatively easy. Splitting a shared database is where incremental modernisation projects stall. Decide explicitly, per slice, which system owns each piece of data.

ApproachHow it worksWatch out for
New component reads legacy databaseQuick start; new code queries existing tablesCouples new code to the old schema; should be temporary
Replicated read modelChange data capture or events populate a new storeReplication lag and monitoring of the pipeline
New owner, legacy syncs backNew component owns writes; changes are synchronised to legacy tables for parts not yet migratedTwo-way sync complexity; conflict rules must be explicit
Full ownership transferLegacy stops writing; tables are retiredAll remaining legacy readers must be found first

Two-way synchronisation is the riskiest pattern. Keep it short-lived and covered by reconciliation checks that compare both sides regularly. Our article on zero-downtime migration covers compatibility and cutover techniques in more detail.

Budgeting for transitional architecture

The strangler fig approach has a cost that rewrites hide: for a period you run, monitor and maintain two systems plus the code that connects them. Make that visible in the budget:

  • Transitional code: routing rules, adapters, synchronisation jobs and reconciliation reports that will be deleted later.
  • Dual hosting: legacy infrastructure cannot be downsized until its last capability moves.
  • Dual knowledge: the team must understand both systems during the transition.
  • Testing across the boundary: end-to-end tests that cover journeys spanning old and new components.
  • Decommissioning work: removing old code, data and infrastructure is a deliberate task, not a side effect.

The usual justification is that this cost is lower than the risk of a failed big-bang cutover, and that each completed slice delivers value. That argument is stronger when each slice has a measurable outcome.

Common failure modes

  • Stalling at the halfway point. The easy slices move, the hard core remains, and the organisation now runs two systems indefinitely. Prevent this by planning the hard slices and the decommissioning milestones from the start.
  • Recreating the monolith. Without clear ownership boundaries and team structures that match them, new services become as tangled as the old system.
  • Adding features only to the legacy side. Agree a rule that new functionality in a migrating area is built in the new system.
  • No observability across the boundary. Tracing requests through both systems is essential for diagnosing issues; see our guide to observability with OpenTelemetry.

Frequently asked questions

Does the strangler fig pattern require microservices?

No. The new system can be a modular monolith. The pattern is about replacing behaviour incrementally, not about a particular target architecture. Microservices are only worth it if team size and scaling needs justify them.

How long does a strangler fig modernisation take?

It depends on the size of the system and how entangled its data is. Because each slice delivers value independently, the more useful question is what the first two or three slices will achieve.

Can we keep adding features while modernising?

Yes, and that is one of the main advantages. The usual rule is that new work in an area being migrated goes into the new system.

What if the legacy system has no API or routing layer?

A seam can often be created by placing a proxy in front of a web application, reading from the database or file exports, or taking over screens in the user interface. An architecture review identifies the practical options.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. Martin Fowler: Strangler Fig Application (22 August 2024) — Origin of the pattern, the four activities, seams, transitional architecture and the need for organisational change.

Is your core system ready to be modernised one slice at a time?

Our architecture consultants identify seams, sequence the work and plan data ownership so modernisation delivers value early. See software architecture consulting.