The Blueprint for Rebuilding Legacy Web Applications Without Downtime
Elena Rostova
Lead Software Engineer at Vexsio
- The Strangler Fig pattern allows teams to replace legacy routes incrementally behind a reverse proxy rather than attempting a high-risk 'big bang' rewrite.
- TypeScript and TanStack Start offer exceptional end-to-end type safety, eliminating runtime routing and data serialization bugs.
- Database schema migrations should always be backwards-compatible through expand-and-contract deployment stages.
- Automated end-to-end testing with Playwright provides the safety net needed to deploy multiple times a day with confidence.
The Danger of the 'Big Bang' Rewrite
Every growing company eventually confronts technical debt: legacy codebases that are slow to modify, brittle under high concurrency, and difficult to staff. Yet, stopping all feature development to embark on a multi-month total rewrite frequently leads to missed deadlines and business failure.
The solution is incremental modernization: replacing one subsystem, route, or API endpoint at a time while the existing application continues to serve live production traffic.
Step-by-Step Modernization Strategy
Phase 1: Edge Routing & Reverse Proxy. Place Cloudflare or AWS CloudFront in front of the application to route requests between legacy and new infrastructure based on URL path.
Phase 2: Establish the Modern Core. Set up a modern TypeScript repository with TanStack Start, Tailwind CSS, and centralized authentication.
Phase 3: Database Expand-and-Contract. Add new columns and tables alongside legacy structures, write dual-write adapters, and migrate read queries before deprecating old schemas.
Phase 4: Route-by-Route Migration. Migrate the most business-critical, high-traffic routes first to demonstrate immediate performance gains and ROI.
About the Author
Elena Rostova
Lead Software Engineer at Vexsio
Part of the senior engineering and growth architecture team at Vexsio, dedicated to building autonomous agents and high-scale digital platforms.