← Blog

· 3 min read

Refactoring Live Systems: Supporting ₹1,000+ Crore in Business Without Downtime

The platforms my teams built support operations contributing more than ₹1,000 crore in revenue. None of them got a big-bang rewrite. Every upgrade happened while the businesses running on them kept trading.

A rewrite looks clean on a whiteboard. In production it means two systems, one frozen, and a cut-over weekend nobody can rehearse. Here's what works instead.

1. Strangle, don't replace

Martin Fowler's strangler fig pattern moves behaviour from the legacy system into new code a piece at a time, instead of replacing it in one go (Fowler, 2024). Put a routing layer in front, send one screen or one API to the new code, and grow from there.

2. Change data in three steps

Schema changes break live systems more often than code does. Parallel change splits a breaking change into expand, migrate and contract (Sato, 2014): add the new column, move readers and writers across, then drop the old one. Every step is reversible on its own.

3. Ship dark, switch on later

Feature toggles let a team change system behaviour without deploying new code (Hodgson, 2017). Deploy on Tuesday, switch on for one branch on Thursday, roll back with a click. Remove each toggle once it has done its job, or they become debt.

4. Protect the revenue path first

Map the few flows that move money, such as orders, invoices and payouts. In my experience, those deserve the most tests, the slowest rollout and someone awake when they change. Reports and admin screens can move fast.

Which technique for which change (my rule of thumb)
ChangeTechniqueRollback
Replace a moduleStrangler figRoute back to legacy
Rename or split a columnExpand, migrate, contractStop before contract
New behaviour, same screenFeature toggleSwitch it off

Is your system ready to change safely?

Score each 0 (no), 1 (partly) or 2 (yes):

  • Routing: you can send one path to new code without touching the rest.
  • Schema: breaking changes go through expand and contract.
  • Toggles: new behaviour ships switched off, with an owner.
  • Revenue map: money-moving flows are listed and tested.
  • Rollback: every release can be undone in minutes.
What your score means (my recommendation)
ScoreNext move
8–10Start strangling the riskiest module.
5–7Build rollback and the revenue map before big changes.
0–4No refactors yet. Add tests around revenue flows first.

Your next step

Pick the legacy module your team fears most. Write down the one route that would let you send ten percent of its traffic to new code. That route is your first sprint.

Sources

  1. Fowler (2024). Strangler Fig. Martin Fowler, updated 22 August 2024.
  2. Sato (2014). Parallel Change. Danilo Sato, 13 May 2014.
  3. Hodgson (2017). Feature Toggles (aka Feature Flags). Pete Hodgson, 9 October 2017.

NEW CODE EVERY MONTH.

Get a note when new Claude Code templates, code recipes or tools go live.

No account required

We email once to confirm. Unsubscribe anytime — it deletes your address.

New drops, every week

Free tools & Claude templates, landing regularly.

We keep shipping new free tools, code recipes and Claude Code templates. Follow @freeyantra on Instagram or join the newsletter so you never miss one.

Follow @freeyantra

or get them by email

Double opt-in. Unsubscribe any time. Privacy