Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Courses/Architecture Leadership
Lesson 23 of 32

Migration strategies

Move from old systems to new ones incrementally with the strangler fig, parallel runs and carefully managed dual writes.

17 min read

Never big bang

A big-bang migration switches everything at once on a chosen weekend. It concentrates all the risk into one moment, offers no partial value, and usually has no realistic rollback. Incremental migration moves traffic, features or data a slice at a time, delivers value early and makes every step reversible. It takes discipline, because for a while you run two systems, but it is the approach that reliably succeeds. Plan the order of slices by risk and value, not by convenience.

The strangler fig

Martin Fowler named this pattern after a vine that grows around a tree until it replaces it. Put a routing layer (API gateway, proxy or facade) in front of the legacy system. Build new functionality in the new system and route those paths to it, then migrate existing paths one by one until the legacy system serves nothing and can be switched off.

  • Start with a low-risk, well-understood slice to prove the path
  • Use an anti-corruption layer so legacy models do not leak into the new design
  • Route by path, tenant or percentage to control exposure
  • Track a burndown of remaining legacy routes

Parallel run and shadow traffic

For logic where correctness matters, such as pricing, tax or ledger calculations, run old and new side by side. Production requests go to the old system, which remains the source of truth; a copy goes to the new system and the results are compared. GitHub's Scientist library popularised this pattern. Investigate every mismatch until the rate is near zero (for example under 0.01% over a full business cycle including month end), then flip which system is authoritative. Shadow traffic must not cause side effects such as emails or charges, so stub them in the new path.

Dual writes and their dangers

When moving data stores, naive dual writes (application writes to both the old and new database) are dangerous: if one write succeeds and the other fails, the stores silently diverge, and there is no transaction across them. Safer options are change data capture (stream the old database's log into the new store with Debezium or similar) or the outbox pattern. Run a reconciliation job that compares the stores continuously, and only switch reads, then writes, once the diff is clean.

Define done

Migrations stall at 90% more often than they fail. The last few consumers are the awkward ones nobody owns. Set a decommission date at the start, track remaining traffic on a dashboard, and budget explicitly for the long tail. A migration is finished only when the old system is switched off and its costs have stopped. Make the remaining work visible to leadership: each month the old system runs costs money, carries security exposure and splits the team's attention. Assign the final consumers to named teams with dates, and escalate early when a team cannot make the date rather than letting the old system linger indefinitely.

Key takeaways

  • Migrate incrementally so each step is reversible and delivers value.
  • The strangler fig routes slice by slice from legacy to new behind a facade.
  • Parallel runs compare outputs on real traffic before switching authority.
  • Avoid naive dual writes; use CDC or an outbox plus continuous reconciliation, and plan for the long tail.

Sign in to track lessons and earn badges.

AI, ML and RAG systems governanceDatabase migrations without downtime

Coming up

Course: 0/32 lessons · 0/10 challenges0%

Build it on the canvas, pass the review (70+) and mark it complete to count it toward the course badge.

  1. 9/10Design an E-commerce CheckoutDesign a tier-0 checkout with PCI scope reduction, idempotent orders, vendor fallbacks and an SLO you can defend.MAJORMedium
10/10
Design a Payment LedgerBring the whole course together on a money-critical ledger and frame it as a decision an executive team could approve.
MAJORHardPRO
All 10 challenges →