Skip to content

Engineering

Legacy software modernization: why rewrites get canceled, and a safer bet

A big-bang rewrite is a bad bet, not a bad pitch. Replacing the system one slice at a time changes the bet and gives the budget review something it can approve.

Computing America. Applications, integrations, data analysis and AI/ML engineering.

Describe the system
3 min readComputing America
A wrecking ball hanging still beside an old brick factory whose windows are still lit.

In short

  • A big-bang rewrite aims at a moving target, rebuilds only what someone remembers, and is hard to rehearse: a trial migration shows volume and load, but real traffic and the cases the team forgot first appear at cutover.
  • The strangler-fig pattern replaces that single date with a series of small, reversible ones: a routing layer sends each capability to the old or the new system, and slices move one at a time.
  • Four practices make slices safe: map what the system does before designing, capture its current behavior in characterization tests, translate the old data model at a boundary, and reconcile the two systems automatically.
  • Slicing the work costs a routing layer and adapter code you later delete.
  • If no slice has moved in a quarter, the project has stalled.

A big-bang rewrite is easy to cancel because it pays nothing until one cutover date, so every month before it is spend with no result to show. That is an argument from the project's shape, not a measured cancellation rate, and finance isn't being timid in making it. Replacing the system in slices behind a routing layer changes the bet.

Why the big-bang version is easy to cancel

A big-bang replacement runs two systems for a long time, then switches on one day. Three things go wrong on the way.

  • The old system keeps changing. Regulation moves, customers ask for things, bugs get fixed. The replacement aims at a moving target, and every change is made twice.
  • No one still on staff may know everything the old system does. The requirements weren't written down. What gets rebuilt is what someone remembers, and the rest surfaces at cutover.
  • Cutover is hard to rehearse. A trial migration shows volume and load, but real traffic and the cases the team forgot first appear on the night it matters.

Change the shape, not the ambition

The strangler-fig pattern (opens in a new tab), named by Martin Fowler after the vine that grows around a tree until the tree is gone, trades the single date for a series of small, reversible ones. Fowler's case for it: replacing a serious system takes a long time, users can't wait that long for new features, and much of the existing behavior is hard to pin down in the first place.

Fig. 1
  1. Users

    • To Routing layer
  2. Routing layer

    Sends each capability to one system

    • To Legacy system · not yet moved
    • To New system · moved
  3. New system

    Grows one slice at a time

    • To Anti-corruption layer
  4. Anti-corruption layer

    Translates the legacy model for the new code

    • To Legacy system
  5. Legacy system

    Shrinks one capability at a time

The routing layer is the only thing users touch, so each capability can move to the new system while the rest stays on the old one.

SourceMartin Fowler, Strangler Fig; Microsoft Azure Architecture Center, Anti-Corruption Layer pattern

Decide per slice which system owns its data. Keep the old store current until the slice has run a full business cycle, or a rollback will lose writes.

Four practices that make slices safe

  1. 1.Archaeology before architecture. Map which programs run, which tables get read and which jobs the business depends on, and log reads for at least one full business cycle, including year end, before deleting anything. Code that no longer runs is deleted, not migrated, and the project gets smaller before it starts.
  2. 2.Characterization tests. Michael Feathers' term for tests that capture what the system does today, including bugs the business has come to rely on. Record real inputs and outputs from the old system and assert that the new one matches. They turn “we think it works like this” into a fact that fails loudly when violated.
  3. 3.An anti-corruption layer (opens in a new tab). Legacy data models encode decades of compromise, and new components that speak them directly re-express the old system in a newer language. Decide early whether the layer is permanent or retired after migration, because that sets how much to invest in it.
  4. 4.Reconciliation as a deliverable. While both systems hold data, compare record by record every night and raise each discrepancy to a named owner. That lets you cut over on evidence.

What the slices cost

Incremental migration adds work a perfect rewrite wouldn't: you maintain a routing layer and sometimes write adapter code you later delete. Stopping partway still leaves a working system.

Before you propose it again, pick the first slice: one capability small enough to ship in a quarter and to roll back in an afternoon.

Sources

  1. 1.Strangler Fig (opens in a new tab), martinfowler.com,
  2. 2.Anti-Corruption Layer pattern (opens in a new tab), Microsoft Azure Architecture Center

Next step

Tell us about the rewrite that stalled.

What the system does, who depends on it, and what killed the last attempt. We will come back with where we would cut the first slice so the risk fits inside one quarter.

Reply
A person replies, not a sequence: within one business day, from someone who would be on the engagement.

Packages

Start with a package

Four packages, each with its price on the page. Pick one and buy it online.

Billing