Strategies to migrate Monolithic Application to Microservices

Microservices are a new norm for the enterprise development and many newly built applications are inherently adopting MS core principles. However many enterprise organizations are seriously thinking/working to migrate their existing monolithic applications to microservices. However this is where most interesting challenges lies, primarily because these monolithic applications are generally mission critical for the continued success of business. Hence migration must be as smooth as possible and we need to put right strategy to reap good benefits. This blog covers the different strategies that we can adopt to break/migrate monolithic application to microservices

Table of Contents:

  • Introduction
  • Standard Constraints
  • Strategies to Migrate
  • Parallel full redesign
  • Standard Microservices
  • Self Contained Systems
  • Migration best practices
  • Summary

Standard Constraints

  • Production application must continue to work smooth and end user should not feel any unwanted change in experience while migrating
  • Migration should not hinder team in adding more functionality to the existing system
  • During migration also, production support and devops team should look at one source of truth rather than multiple

Strategies to Migrate

There are few high level strategies we can follow while migrating monolithic applications. Approach will vary based on project conditions and as a architect you should take a call on right approach based on multiple constraints in project.

Parallel full redesign

Do not touch monolithic application, but start building a parallel application with MS architecture principles. This like a building a new application which exhibits same functional behavior but with microservices.

Pros:

  • Existing monolithic application won’t be disturbed, hence user will not experience any challenges related to migration
  • Will have lesser constraints for developers, hence it is easy to architect, design and code

Cons:

  • Leads to typical waterfall model. Don’t know the outcome of the effort until last leg i.e. till all the time and money are spent

Standard Microservices

Identify the independent modules in existing monolithic application and convert the backend functionality into Microservices and replace all the direct calls for this module across the application( including UI and Backend) with microservice calls. Keep doing the same step for all the modules in iterative form till complete application is broken into microservices. Sometimes you may need to divide a microservice module into multiple microservices in order bring in better granularity.

Pros:

  • Part of application will be migrated in each iteration, hence customer can see iterative progress on migration
  • Lessons learned in previous iteration can be adopted in next iteration, hence team will continue to grow strong with each iteration

Cons:

  • Changes in existing monolithic application will be high in order to integrate with newly created microservices module.
  • UI code will continue to be monolithic

Self Contained Systems:

Identify the module which can work independently, then convert the backend into microservices and rebuild UI for that specific portion as independent UI module. Then replace old functionality with both UI and Microservices(Self Contained Systems). Self Contained Systems contains both backend and UI and all the time they are expected to work as complete and independent module. These modules are loosely integrated with main monolithic application i.e. many times with simple URL reference. Iterate the above process till the complete monolithic application is migrated to Self Contained Systems. After completion of migration, application will be loosely coupled group of UI components and set of microservices.

Pros:

  • Part of application will be migrated in each iteration, hence customer can see iterative progress on migration
  • Lessons learned in previous iteration can be adopted in next iteration, hence team will continue to grow strong with each iteration
  • UI also gets migrated to independent modules hence development will become faster and quicker for each module
  • User will see visible changes for each iteration in the application

Cons:

  • As more modules move to Self Contained Systems, communication among these modules will become much more complex especially at UI level
  • Not all famous UI frameworks we have now has very good support for versioning management for modules. As this support is not foolproof, we may end up having regression issues when two UI independent modules become incompatible.

Migration Best Practices

Best practices vary from one strategy to another strategy. However there a generic practices that we must adopt irrespective of strategy we choose. We will cover those generic practices here.

  • Identify the most independent module and migrate that first.
  • Never allow the migrated microservices module code to continue in monolithic application.
  • Build or Choose a framework which takes care of cross cutting concerns and developers will focus only on business functionality
  • Do not hesitate to break the existing microservice to further smaller microservices

Source: https://walkingtree.tech/strategies-migrate-monolithic-application-microservices-2/

--

--

--

WalkingTree is an IT software and service provider recognized for its passion for technology.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Create AMI From Existing EC2 Instances

Goblin Special (2017)

Kintsugi: Automatically Solving Git Conflicts in Xcode Project Files

A graph depiciting how Kintsugi resolves merge conflicts.

Getting started with Rails, Tests, Continuous Integration & Deployment

Error Handling à la Uncle Bob

.NET Core API with Swagger

Best Agile Tools for Project Management in 2020

Learn to Build a Swap Application with Solana Wallet Adapter and Raydium SDK — Part 1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
WalkingTree Technologies

WalkingTree Technologies

WalkingTree is an IT software and service provider recognized for its passion for technology.

More from Medium

Stateless vs. Stateful Microservices: Addressing the Benefits and Quandaries

When Should You Apply CQRS Software Architecture Pattern?

API Rate Limiting: How to avoid hitting rate limits in API integration