[SURVEY RESULTS] The 2024 edition of State of Software Modernization market report is published!
GET IT here

Migration From Monolith To Microservices Using Strangler Pattern

Last updated on
May 24, 2024


10 phases of migration from monolith to microservices

1. Identify and isolate components

2. Build the Strangler facade

3. Design and develop microservices

4. Build data migration and management strategy

5. Incrementally replace functionalities

6. Test each microservice

7. Set up Continuous Deployment and Integration

8. Gradually decommission the monolith

9. Monitor and optimize performance

10. Update documentation and share knowledge


Migration From Monolith To Microservices Using Strangler Pattern


In this article, we’ll walk you through 10 phases and 21 detailed steps of migrating from monolith to microservices using the strangler pattern. 

What else?

  • example of migration using the strangler pattern and trickle approach to data migration,
  • set of important information about potential risks (with tips on how to mitigate),
  • potential advantages of migration.

Let's dive in.

Why microservices?

Microservices provide scalability, technology flexibility, faster deployments, resilience, and easier maintenance in complex applications. They align well with modern DevOps practices and enable better handling of large-scale systems through independent scaling and updating of services.

Why the strangler pattern?

The Strangler Pattern is preferred for migrating from a monolithic architecture to microservices due to its gradual, less risky approach. It allows for a controlled transition by slowly replacing parts of the monolith, ensuring minimal disruption and continuous operation. 

This pattern is particularly effective in managing risk, enabling learning during the transition, and providing flexibility in prioritizing which components to migrate first.

Why monolith to microservices with a strangler pattern?

Transitioning from a monolith to microservices using the Strangler Pattern is chosen for its ability to manage complexity and risk effectively during the migration process. This approach allows for a gradual, controlled transition, which is essential in large, complex systems where a sudden overhaul could be risky and disruptive. 

The Strangler Pattern enables the new microservice architecture to be built and tested alongside the existing monolithic system, ensuring continuous operation and minimizing downtime. This phased approach also allows teams to learn and adapt as they progress, reducing the likelihood of large-scale failures and allowing for a smoother, more manageable transition.

Main steps of the Strangler Pattern for monolith to microservices migration

Let’s start with the three main steps that depict all the phases: Transform, Coexist, Eliminate:


This initial phase involves identifying and isolating specific functionalities within the monolithic application that are suitable for conversion into microservices.

These functionalities are typically those that can be decoupled with minimal dependencies or those that would benefit significantly from a microservice architecture, such as scalability or performance improvements. Once identified, these components are gradually transformed into separate, standalone services. 

This transformation often includes redefining the data model, developing new APIs, and re-implementing business logic in a more modular fashion.


During the coexistence phase, the new microservices operate alongside the remaining parts of the monolithic application. This stage is critical for ensuring continuous operation without service interruption. 

A key aspect here is the establishment of communication mechanisms between the microservices and the monolith, often achieved through APIs or messaging systems. This phase allows for iterative testing and refinement of the new microservices in a live environment, ensuring they interact correctly with the existing monolithic components.


The final phase involves systematically eliminating the remaining parts of the monolith. As more functionalities are transformed into microservices, the monolith shrinks and becomes less complex. Eventually, all significant functionalities are migrated to microservices, and the monolith can be decommissioned. This step is crucial for realizing the full benefits of the microservices architecture, including improved scalability, easier maintenance, and faster deployment cycles.

Throughout this process, careful planning and testing are essential to ensure that system integrity is maintained and that the new microservices architecture can adequately support the application's requirements.

Now, let’s proceed to the more detailed view on this process.

Replacing monolith piece by piece

Replacing a monolithic application piece by piece involves a strategic and carefully planned approach, usually following the Strangler Pattern. This pattern allows you to gradually replace parts of the monolith with microservices. 

Here’s a step-by-step instruction of replacing the monolith by microservices using the strangler pattern. It’s divided into 10 phases and 21 detailed steps.

1. Identify and isolate components

  • Step 1: Analyze the monolith. Start by understanding the existing monolith - its structure, dependencies, and functionalities.
  • Step 2: Identify bounded contexts. Using Domain-Driven Design (DDD) principles, identify bounded contexts within the monolith. These are candidates for microservices.
  • Step 3: Prioritize components. Decide the order of extraction based on factors like complexity, dependencies, and business value.

2. Build the Strangler facade

  • Step 4: Create a facade. Implement a Strangler Facade, which is an intermediary layer that intercepts calls to the monolith and routes them to either the monolith or the new microservice.
  • Step 5: Routing decisions. The facade should be capable of determining whether a request should be handled by the monolith or a microservice.

3. Develop microservices

  • Step 6: Build the microservices architecture. Design and develop microservices following best practices - each microservice should be loosely coupled, independently deployable, and centered around a single business capability.
  • Step 7: Implement APIs. Develop APIs for communication between the microservices and the monolith.

4. Data migration and management

  • Step 8: Data strategy. Plan a data migration and management strategy. This may involve duplicating data temporarily or implementing a shared database pattern initially.
  • Step 9: Data ownership transfer. Gradually transfer data ownership from the monolith to the respective microservices.

5. Incremental replacement

  • Step 10: Migrate functionality. Start moving functionality from the monolith to the microservices. Begin with less complex or more isolated functionalities.
  • Step 11: Update routing. As each piece is replaced, update the routing rules in the Strangler Facade to redirect the requests to the new microservices.

6. Testing and Quality Assurance

  • Step 12: Thorough testing. Each microservice should be thoroughly tested, including its integration with the remaining parts of the monolith.
  • Step 13: Monitoring and logging. Implement robust monitoring and logging to ensure smooth operation and quick issue resolution.

7. Continuous Deployment and Integration

  • Step 14: CI/CD pipelines. Set up continuous integration and continuous deployment pipelines for the new microservices.
  • Step 15: Feature flags. Use feature flags to toggle new functionalities on and off without deploying new code.

8. Iterative decommissioning

  • Step 16: Decommission monolith. Gradually decommission the monolith, piece by piece, ensuring business functionalities are not impacted.
  • Step 17: Database decoupling. Eventually, decouple and dismantle the monolithic database.

9. Finishing and optimization

  • Step 18: Performance tuning. Continuously monitor and tune the performance of the new microservices.
  • Step 19: Refactoring and improvements. Post-migration, refactor and optimize the new services for better performance, scalability, and maintainability.

10. Documentation and knowledge sharing

  • Step 20: Update documentation. Regularly update documentation to reflect the new architecture and the changes made.
  • Step 21: Team training. Ensure that the development team is up-to-date with the changes and trained in maintaining and developing the new microservices architecture.

Example of migration strategy with the strangler pattern and trickle approach

To get into even more detail, let’s take a look at the specific example. In this walkthrough, we’ll focus on migrating monolith to microservices using

  • Strangler pattern for system migration
  • Trickle (incremental) approach to data migration

1. Initial assessment and decomposition strategy

  • Codebase analysis: Deep dive into the monolith's codebase to identify bounded contexts. Use domain-driven design (DDD) principles to delineate microservices.
  • Dependency mapping: Use tools like static code analysis to map out dependencies within the monolith.

2. Strangler Pattern implementation

  • Proxy layer introduction: Implement a proxy layer (e.g., API Gateway) to intercept incoming requests. This layer will decide whether to route the request to the monolith or a microservice.
  • Incremental feature migration: Migrate features one by one from the monolith to respective microservices. Start with low-risk or loosely coupled modules.
  • Refactoring and domain modeling: Continuously refactor the monolith during migration. Ensure new microservices are modeled around business capabilities.

3. Data migration: Trickle approach

  • Schema analysis and microservice database design: Analyze the monolithic database schema. Design microservice-specific schemas that align with each service's domain.
  • Data migration pipeline: Set up a data migration pipeline. This might involve ETL processes, data streaming, or real-time replication mechanisms.
  • Data synchronization: Employ techniques like Change Data Capture (CDC) to keep the microservice databases synchronized with the monolithic database during the transition.

4. Infrastructure and deployment

  • Containerization and orchestration: Containerize the new microservices. Use orchestration tools like Kubernetes for deployment and management.
  • CI/CD pipeline adjustment: Adapt or rebuild CI/CD pipelines to support microservices. Implement blue-green or canary deployments for minimal downtime.

5. Testing and monitoring

  • Automated testing: Leverage automated testing at multiple levels (unit, integration, end-to-end).
  • Distributed tracing and logging: Implement distributed tracing (e.g., using OpenTelemetry) and centralized logging to monitor the system's health and diagnose issues.

6. Performance tuning and scaling

  • Load testing: Conduct load testing to understand the performance under different scenarios.
  • Resource optimization: Optimize resource usage based on the load. Implement auto-scaling where necessary.

7. Finalizing the migration

  • Full transition to microservices: Gradually decommission the monolith as services are migrated.
  • Database decoupling: Once all relevant data is migrated, decouple and decommission the monolithic database.

8. Post-migration enhancements

  • Microservices fine-tuning: Post-migration, fine-tune each microservice based on real-world performance metrics.
  • Advanced observability: Implement advanced observability solutions for deeper insights into system performance and user experience.

What are the challenges of the strangler pattern used in migration to microservices?

While the Strangler Pattern offers significant advantages for migrating from a monolithic architecture to microservices, it also presents several challenges that need to be carefully managed:

Complex coexistence management

During the transition, the monolith and new microservices need to coexist and communicate effectively. Managing this coexistence, particularly ensuring data consistency and handling inter-service communications, can be complex.

How to mitigate:

  • Implement an API gateway to manage communication between the monolith and microservices.
  • Use the Strangler Pattern to gradually reroute specific functionalities, ensuring seamless interaction.

Incremental refactoring overhead

The process of incrementally refactoring a monolithic application into microservices can be time-consuming and resource-intensive. It requires continuous monitoring, testing, and adjustments over an extended period.

How to mitigate:

  • Prioritize components for refactoring based on business value and complexity.
  • Adopt agile methodologies to manage the process iteratively and efficiently.

Dependency management

Identifying and managing dependencies within the monolith can be challenging. Understanding how different parts of the application are interconnected is crucial to avoid breaking functionalities during the migration.

How to mitigate:

  • Use tools for static and dynamic analysis of the monolithic application to identify and manage dependencies.
  • Refactor in small steps, validating after each step to ensure the system remains stable.

Data migration issues

Moving data from a monolithic system to distributed microservices can be tricky, especially when dealing with large datasets or complex data relationships. Ensuring data integrity and consistency during this migration is a significant challenge.

How to mitigate:

  • Plan a phased data migration approach, starting with less critical data.
  • Use techniques like shadowing and parallel runs to ensure data integrity.

Performance overheads 

The introduction of network calls between the monolith and microservices (which were internal calls within the monolith) can introduce latency and performance overheads.

How to mitigate:

  • Optimize network calls and consider asynchronous communication where possible.
  • Monitor performance closely and scale microservices accordingly.

Skill set and learning curve

Teams might need to upskill or adapt to new technologies and approaches inherent in microservices architecture, like containerization, orchestration, and API management. This learning curve can slow down the migration process.

How to mitigate:

  • Invest in training and workshops for teams on microservices technologies and best practices.
  • Consider hiring or consulting with experts for critical areas.

Increased operational complexity

Managing multiple microservices, as opposed to a single monolithic application, can increase operational complexity. This includes challenges in monitoring, logging, and troubleshooting distributed systems.

How to mitigate:

  • Leverage automated tools for monitoring, logging, and managing microservices.
  • Adopt a service mesh for managing service-to-service communications.

Partial refactoring risks

There is a risk of ending up with a partially refactored system that doesn’t fully leverage the benefits of microservices, especially if the migration process is halted midway due to budgetary, time, or resource constraints.

How to mitigate:

  • Maintain a clear roadmap and regularly reassess priorities to ensure alignment with business objectives.
  • Avoid partial refactoring by committing to small, manageable releases.

Consistency and transaction management

Ensuring transactional integrity and consistency across distributed services is more challenging than in a monolithic architecture. Implementing strategies like eventual consistency requires careful design and testing.

How to mitigate:

  • Implement strategies like eventual consistency, compensating transactions, or sagas for distributed transaction management.
  • Carefully design and test these patterns before implementation.

Cultural and organizational change

Adopting microservices often requires a shift in organizational culture and structure, moving towards smaller, cross-functional teams. This change can be difficult and requires careful management.

How to mitigate:

  • Foster a culture that supports learning, experimentation, and collaboration.
  • Restructure teams around services (cross-functional teams) for better ownership and autonomy.

Potential for increased costs

The migration process and the eventual microservices architecture could lead to increased costs, both in terms of infrastructure and operational management, particularly if not well-optimized.

How to mitigate:

  • Conduct cost-benefit analysis at each stage to ensure alignment with budget constraints.
  • Optimize resource usage with cloud-native solutions and cost-effective infrastructure.

Security considerations

The distributed nature of microservices introduces new security challenges, such as securing inter-service communications and managing multiple attack surfaces.

How to mitigate:

  • Implement robust security practices, including identity and access management, secure service communication, and regular security audits.
  • Educate teams on common security pitfalls in microservices architectures.

What are the advantages of using the strangler pattern in migration from monolith to microservices?

The Strangler Pattern, when used for migrating from a monolithic architecture to a microservices architecture, offers several significant advantages:

  • Incremental migration: The Strangler Pattern allows for the gradual migration of functionality from the monolith to microservices. This step-by-step approach reduces the risk of system failures and allows for easier troubleshooting and rollback if issues arise.
  • Minimal disruption: Since the migration happens incrementally, the existing monolithic application remains operational, ensuring continuous service delivery. This is particularly important for businesses that cannot afford significant downtime.
  • Risk management: Migrating small pieces one at a time reduces the risk compared to a full rewrite. Problems can be detected early and fixed without impacting the entire system, making the process more manageable.
  • Testing and Quality Assurance: With smaller, more manageable changes, testing can be more thorough and focused. Each new microservice can be rigorously tested before it replaces the corresponding part of the monolith, ensuring stability and performance.
  • Learning and adaptation: The gradual nature of the process allows teams to learn and adapt as they progress. With each service migrated, the team gains more understanding of microservices architecture and can apply these learnings to subsequent migrations.
  • Flexibility in prioritization: The Strangler Pattern allows organizations to prioritize which components to migrate based on business needs, technical readiness, or other factors. This flexibility ensures that the most critical or beneficial parts can be migrated first.
  • Improved scalability and performance: Microservices can be independently scaled, which can lead to better resource utilization and overall system performance, especially for parts of the application with different scaling needs.
  • Technology stack modernization: This pattern provides an opportunity to update and modernize the technology stack. Each new microservice can potentially be implemented using more current technologies that are better suited to the service’s needs.
  • Enhanced maintainability: Microservices are generally easier to maintain and update than a monolithic application. Smaller, well-defined codebases and services are easier to understand and modify.
  • Organizational alignment: The process encourages a shift towards smaller, cross-functional teams, each responsible for specific services. This can improve team autonomy and alignment with business capabilities.
  • Better fault isolation: In a microservices architecture, a failure in one service is less likely to bring down the entire system. This isolation improves the overall reliability of the application.
  • Iterative refinement: The gradual migration allows for continuous refinement and improvement of both the migration process and the microservices themselves.

How to begin - your next/first steps:

If you want to migrate monolith to microservices using strangler pattern, start smoothly doing these 3 steps:

Step 1: Conduct a comprehensive assessment of the monolith:

  • Analyze the existing monolithic application to understand its architecture, functionalities, and dependencies.
  • Identify bounded contexts and logical service boundaries within the monolith. This helps in determining which functionalities can be broken down into microservices.
  • Evaluate the current challenges and limitations of the monolithic system, including performance bottlenecks, scalability issues, and maintenance complexities.

Step 2: Define the target microservices architecture:

  • Envision the final microservices architecture, outlining how each microservice will function, communicate, and scale.
  • Establish the technology stack and tools required for the microservices, including languages, frameworks, container orchestration platforms (like Kubernetes), and CI/CD tools.
  • Plan for API strategies, inter-service communication, and data management across the distributed environment.

Step 3: Develop a detailed migration plan with the strangler pattern:

  • Prioritize components for migration, starting with those that are less complex, have fewer dependencies, or offer significant business value when migrated.
  • Design the Strangler Facade, an intermediary layer that intelligently routes requests between the monolith and new microservices.
  • Outline the incremental steps for the migration, including timelines, resource allocation, and phases for testing and deployment.

Frequently Asked Questions

No items found.

Our promise

Every year, Brainhub helps 750,000+ founders, leaders and software engineers make smart tech decisions. We earn that trust by openly sharing our insights based on practical software engineering experience.


Olga Gierszal
IT Outsourcing Market Analyst & Software Engineering Editor

Software development enthusiast with 6 years of professional experience in the tech industry. Experienced in outsourcing and nearshoring market analysis. Our expert in presenting tech, business, and digital topics in an accessible way.

Read next

No items found...

Get smarter in engineering and leadership in less than 60 seconds.

Join 300+ founders and engineering leaders, and get a weekly newsletter that takes our CEO 5-6 hours to prepare.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

previous article in this collection

It's the first one.

next article in this collection

It's the last one.