Back to Research
Architecture2025-11-26·7 min read read

The Strangler Fig Migration: How We Replaced a Legacy System Without Downtime

migrationstrangler figlegacy systemsarchitecturerefactoring
The Strangler Fig Migration: How We Replaced a Legacy System Without Downtime

A manufacturing client had a fifteen-year-old PHP inventory system. No tests, no documentation, one developer who understood it (retiring in eight months). Four thousand transactions per day, deeply integrated with their ERP and warehouse scanners. They wanted a full rewrite. We said no.

Full rewrites of running production systems fail more often than they succeed. Teams underestimate hidden complexity, the rewrite takes twice as long, and the legacy system still needs maintenance. We proposed a strangler fig migration instead.

Month one: we deployed a Cloudflare Workers API gateway in front of the legacy app. All traffic hit the gateway first. Initially it proxied everything unchanged. Zero functionality change, but we gained routing control and comprehensive request logging.

Month two: we analyzed gateway logs and categorized all eighty-seven endpoints by traffic, criticality, and migration complexity. Forty-three endpoints covered ninety-five percent of traffic.

Months three and four: we built the new inventory service in TypeScript with PostgreSQL for the ten highest-priority endpoints, matching the legacy request and response formats exactly. The gateway routed specific endpoints to the new service using feature flags, starting at one percent of traffic and ramping to one hundred percent over two weeks per endpoint.

The verification layer was critical. For the first month, the gateway sent every request to both systems, compared responses, and logged differences. This shadow mode caught twelve bugs we would have missed with testing alone -- edge cases in date formatting, currency rounding, and null handling.

Months five through seven: the remaining endpoints migrated faster with established patterns. We used Debezium CDC to keep both databases in sync during the transition. Seven months total, zero downtime, zero big-bang cutover risk.

Total cost: sixty-five thousand dollars. The competing full-rewrite estimate was one hundred twenty thousand over twelve months. We delivered in less time at half the cost.

Key lessons: get routing control before changing functionality. Shadow mode catches bugs tests miss. Migrate by endpoint, not feature. Keep the legacy system running longer than you think necessary. And never attempt a big-bang database migration.

About the Author

Fordel Studios

AI-native app development for startups and growing teams. 14+ years of experience shipping production software.

Want to discuss this further?

We love talking shop. If this article resonated, let's connect.

Start a Conversation

Ready to build
something real?

Tell us about your project. We'll give you honest feedback on scope, timeline, and whether we're the right fit.

Start a Conversation