
Modernizing a legacy application is a common challenge for organizations aiming to stay competitive in today’s technology-driven world. However, when the legacy system is mission-critical, has a huge user base, and requires constant updates for business needs.
The migration process becomes even more complex. This blog post explores how we tackled such a scenario using the Strangler Fig Pattern to achieve a seamless parallel migration.

Scenario: Migrating an ASP.NET MVC5 Application to ASP.NET Core and Next.js
The client had a legacy application developed in 2010 using ASP.NET MVC5 for the backend and jQuery for the frontend. The system had grown over the years, serving a large user base with roles like Admin, SuperAdmin, Manager, and Customer. The client wanted to modernize the backend using ASP.NET Core and the frontend using Next.js, while ensuring:
- Continuous operation of the existing system without downtime.
- No disruption to users during the migration process.
- Flexibility for users to switch between the old and new versions.
Complicating matters, the existing system required frequent updates due to new business logic, making a complete halt for a full rewrite infeasible.

The Challenges in Migration
- Simultaneous Development: The legacy system still needed regular updates and enhancements, making it impossible to freeze development during migration.
- Authentication and Authorization: Both systems needed to share cookies and maintain a consistent authentication experience.
- Incremental Modernization: Migrating the entire system at once was impractical given the complexity and time constraints.
- User Experience: Users needed a smooth transition with no learning curve or downtime.

Enter the Strangler Fig Pattern
The Strangler Fig Pattern, introduced by Martin Fowler, is a design pattern for incremental application modernization. Inspired by the way a strangler fig plant grows around a host tree and eventually replaces it, this pattern allows you to gradually replace parts of a legacy system with new functionality.
Why Use the Strangler Fig Pattern?
- Incremental Migration: Enables step-by-step modernization without disrupting the entire system.
- Parallel Functionality: Allows the legacy and new systems to coexist, ensuring continuity.
- Reduced Risk: Minimizes the risk of migrating everything at once.
- User-Centric Transition: Provides users with flexibility to use either the old or new version during the transition.

Implementing the Strangler Fig Pattern: A Use Case
In our project, we applied the Strangler Fig Pattern by focusing on role-based incremental migration. Here’s how we approached it:
- Identify Boundaries: The application had multiple user roles (Admin, SuperAdmin, Manager, Customer). We decided to start with the Admin role, as it had well-defined boundaries and independent functionality.
- Common Login System: A shared authentication system ensured users could log in once and be redirected to the appropriate version (legacy or modernized).
- Routing Logic:
- When a user logs in, the system determines their role.
- If the user is an Admin, they are redirected to the new Next.js frontend and ASP.NET Core backend.
- Other roles continue to use the legacy application.
- Gradual Expansion:
- After successfully migrating the Admin role, we migrated other roles (SuperAdmin, Manager, Customer) one by one, ensuring thorough testing at each step.
- Cookie Sharing for Authentication:
- Both the legacy and modernized systems shared cookies, allowing seamless session management during the transition.
- Rollback Flexibility:
- Users had the option to revert to the old version during the transition phase, ensuring no loss of functionality.

Benefits of the Strangler Fig Pattern
- Continuous Deployment: New features and bug fixes for the legacy system continued while parts of the application were modernized.
- Reduced Downtime: No major downtime or system-wide disruptions occurred during the migration.
- User Flexibility: Users could seamlessly switch between old and new versions, ensuring a smooth transition.
- Future-Proofing: The modernized system was built with cutting-edge technologies, ensuring better scalability and maintainability.
Key Considerations for Using the Strangler Fig Pattern
- Identify Migratable Modules: Break down the application into smaller, independently deployable components.
- Shared Services: Maintain common services like authentication, logging, and configuration for both systems.
- Comprehensive Testing: Test thoroughly during each step to ensure a consistent user experience.
- Monitoring: Continuously monitor both systems for performance and user feedback.
Real-World Applications That Used the Strangler Fig Pattern
The Strangler Fig Pattern has been successfully used by various organizations to modernize their legacy systems. Here are some notable examples:
1. eBay
eBay, one of the world’s largest e-commerce platforms, faced challenges with their monolithic architecture. They used the Strangler Fig Pattern to incrementally replace parts of their legacy system with a modern, microservices-based architecture. This approach allowed them to keep the platform running smoothly while introducing new features and technologies.
2. Netflix
Netflix, a pioneer in video streaming, initially operated on a monolithic architecture. As they expanded, they adopted the Strangler Fig Pattern to transition to a microservices architecture. By replacing functionality piece by piece, Netflix was able to scale globally and provide a seamless user experience without disrupting their services.
3. Amazon
Amazon used the Strangler Fig Pattern during their transition from a monolithic application to a service-oriented architecture (SOA). This allowed them to manage the growing complexity of their e-commerce platform while ensuring uninterrupted service for millions of users.
4. Australian Taxation Office (ATO)
The Australian Taxation Office faced the challenge of modernizing its legacy systems while supporting ongoing operations. Using the Strangler Fig Pattern, they incrementally replaced components of their tax processing system, ensuring compliance with government regulations and maintaining service availability.
5. Spotify
Spotify used the Strangler Fig Pattern to modernize its backend infrastructure. They incrementally replaced parts of their system to introduce new features like personalized recommendations and playlists while ensuring uninterrupted service for their millions of users.
6. Shopify
Shopify adopted the Strangler Fig Pattern to migrate parts of their monolithic system to a more modular architecture. By doing so, they ensured that their e-commerce platform could scale with the demands of their merchants without any downtime.
Why These Companies Chose the Strangler Fig Pattern
These companies faced similar challenges:
- Large, complex legacy systems.
- High user traffic with no room for downtime.
- Continuous demand for new features and updates.
The Strangler Fig Pattern allowed them to:
- Incrementally modernize their systems without disrupting ongoing operations.
- Manage risks by isolating changes to specific components.
- Scale their platforms for future growth.
External Resources:
- The Strangler Fig Pattern in Microservices
- Strangler Fig Pattern – Azure Architecture Center
- Strangler Fig Pattern – AWS Prescriptive Guidance
- What is the Strangler Fig Pattern and How it Helps Manage Legacy Code
- Refactoring Legacy Code with the Strangler Fig Pattern
My Others Tutorial Links:
- Unlock the Secrets of ASP.NET Core 9 Authentication and Authorization: A Powerful Step-by-Step Guide (Part 1)
- Simplifying Microservices Communication with Ocelot in ASP.NET Core 9.0
- Master Simplified Microservices Communication with YARP API Gateway in ASP.NET Core 9.0
- Unlock the Benefits: Why You Should Migrate to ASP.NET Core 9 and Explore Its Exciting New Features
Conclusion
The Strangler Fig Pattern is a powerful approach to modernizing legacy applications while maintaining uninterrupted service. By migrating parts of the application incrementally, you can reduce risks, manage complexity, and ensure user satisfaction. In our case, this pattern allowed us to gradually replace a decade-old system with a modern, scalable solution using ASP.NET Core and Next.js, paving the way for future growth and innovation.