Migrating to Microservices Architecture


By Jeevan Babu February 13, 2020 18 min read

An In-Depth guide to migrate your monolithic finTech app to microservices

The migration from a monolithic application to a microservice architecture itself is heroic. If you aim to scale up the operation and speed while escaping high costs,  then migration to microservices is a one-stop solution for you. 

The migration from a monolithic application to a microservice architecture itself is heroic. If you aim to scale up the operation and speed while escaping high costs, then migration to microservices is a one-stop solution for you.

The financial ecosystem is rushing to accord itself with the digital-centric mobile world. FinTech industries are rapidly experimenting with their approaches to incorporate highly flexible and scalable architectures, so that, they aren’t left behind the competition and fail to fulfill the demands of the customers.

The real take of microservices is providing high speed with reduced costs and higher scalability and flexibility.

Monolithic structure fails when a fintech application gets bigger catering to the ever-increasing requirements of the customers. Financial services are never constant and always face changes that have to be incorporated into their systems.

With a monolith system, after a certain size, the organization finds it difficult to manage and comes across various cooperation bottlenecks. At this stage, it becomes necessary to fix the flow and streamline the process by enhancing collaboration. This entire scenario has only one solution known as Microservice Architecture that calls for higher flexibility and scalability. 

This gives rise to the migration of fintech applications to microservices and hits the top of the to-do list for some key FinTech players. 

But migrating an entire system that is on a monolithic architecture is not a child’s play. Moreover, the primary challenge that organizations face is how they can migrate their microservices in the existing applications. 

Ways to migrate your monolithic application to a microservice architecture

To migrate your monolithic app to a microservice architecture, you have two approaches:

Split a core monolith into microservices

Splitting a core monolith application into microservices is difficult and costly. A complete revamp of the application may take a year of exhaustive work of skilled domain experts.

Companies often jump to this option and take a chance to get rid of the existing and bulky online system that is failing to cope up with the load. Therefore, they desire for this option to re-platform the out-of-date software. 

This decision isn’t easy and has a requirement of substantial investment and manpower. Moreover, if you are determined to break up your monolith architecture and build a new application with microservice architecture, then make sure you have experienced architects for this purpose. 

Keep the Monolith and build Microservices around it

Is your initial architecture working fine? Do you have a large team that manages the monolith app swiftly? Then this second approach is a great option where you can build new features as microservices. The core team that developed the monolith will manage it and the new features added as microservice will be managed by the others who will be handling these services individually. 

The only bottleneck with this approach is while reformatting the monolith, the process will be tedious and challenging as compared to opting microservice architecture at the beginning. For a long-term strategy, it is recommended to analyze all your business goals and pre-requisites before choosing this option. 

Migration from a monolithic architecture to a microservice architecture

The concept of microservice architecture emerged to cater to the needs of modern customers. But adopting this solution is ideal when there is a practical need for businesses. To decide on the migration, there is no fixed criteria or time. If a business is struggling with cooperation deadlocks then, your business needs to transfer its structure and migrate to a microservice architecture. 

Let us explore the steps to be followed while migrating from monolithic to microservice architecture.

Step 1: Disjoin Simple Services

Start dismantling your existing system by separating the lesser complex services. The functionalities required for this step are:

  • Enter the deployment environment immediately
  • To set up, evaluate and move services, create a new type of constant delivery channel.
  • Fixing errors, monitoring and safeguarding capabilities 

Note: The developers begin from refactoring of services that are coupled from the monolith architecture and don’t modify the front-end.

The delivery team optimizes the delivery. To handover self-served APIs for separate deployable services,  the delivery team has to construct the least infrastructure.

Step 2: Reduction in Monolith Interdependence

Once the microservices are decoupled, minimize dependencies on the rest of the monolithic structure. Since microservices have quick and independent release cycles, maintenance cost is less and the speed to change is rapid.

The key point is to adapt the way that helps in disjoining the root capabilities through the elimination of links back to the monolith.

Step 3: Disjoining Viscous Capabilities

You might face a situation where you fail to decouple without interdependence back to the monolith. This happens due to a faulty monolith architecture where the realm of the architecture isn’t properly defined. 

In such cases, it is recommended to explore the viscous capabilities of the system. When you are able to discover the viscous capabilities, with the help of a well-defined domain, reconstruct it, and then separate into individual services. 

Note: Derive the microservices one by one.

Step 4: Disjoin the Vertical Capabilities and Discharge Data

Why are we decoupling the capabilities? Our aim is to separate them from the monolith architecture and reduce dependencies. The monolithic structure houses a number of strongly coupled layers with hardcore dependencies. These layers need an urgent simultaneous discharge. 

You can vertically take off the capabilities, disjoin the root capability along with the data, and switch all the front-end applications to the new APIs. 

Note: If there are manifold applications dependent on centrally shared data, then this may block the disjoining of the services. Therefore, the teams should choose the best strategies that suit their systems for data migration.

Step 5: Separate the Significant and Variable Business Functions

The team has to give a lot of inputs while separating a capability from the monolith. This involves:

  • Data extraction
  • Extraction of the Front-end components
  • Logic extraction
  • New service redirection

Since a lot of efforts are associated with the separation of the capabilities, the team has to constantly calculate the expenditure and advantage of decoupling. 

If your aim is just to speed up the changes in the existing system, then it is recommended to disjoin the code sections undergoing variations continuously. 

Step 6: Not Code, focus on disjoining capability 

The two ways to extract the capability:

  • Extract the code
  • Rewrite the code

The first method is commonly used because of the emotional attachment with the current code where they perform extraction by reusing the code. Often, the importance of rewriting the code is neglected and developers concentrate more on choosing high cost and labor for reusing the code. 

The best method is to rewrite the code as it provides an opportunity to revise the business capabilities and help to modify as per the current market trends and requirements. 

Step 7: Time to move from Macro to Micro

Are you thinking about where to begin?

Discover the domain perimeters

Practice domain-oriented techniques

Maintain consistency throughout the process to avoid improper functioning

Note:

It is recommended to define the boundaries for checking the size of the microservice best suiting your organization. 

Since microservice architecture is all about how you can divide your monolithic app into smaller services, see that, the services are smaller enough to handle and operate by the team.

Step 8: Don’t get over-excited

You have been patient throughout the process. Don’t let the thought of ‘Finally! I have done the migration!” rush into you. In the long-run, after the migration process, the organization faces issues like lack of funds, lack of focus due to other commitments, lack of support from the leads due to switching jobs, and so on. 

Always opt for a near to complete developmental stage which is nearest to its target stage. 

Though we have multiple evolving microservices platforms, the Google cloud is one of the most popular platforms for migrating your legacy app to microservice architecture. Other emerging platforms are Microsoft’s Azure BizTalk Microservices, Gilliam which is a platform as a service model (PaaS), LSQ is also a PaaS platform, and Pivotal which is a native cloud platform.   

The migration of your monolithic app to microservices using Google Cloud is given below: 

Steps to migrate your monolith app to microservice architecture using Google Cloud

  • Identify a set of classes as a candidate to become a microservice
  • Facilitate rollback by leaving the existing code operational and in place in the legacy application.
  • In your existing repository, create a new code repository or a sub-directory at least.
  • Copy the classes into the new location.
  • Write a view layer that provides the HTTP API hooks and formats the response documents in the correct manner.
  • Formulate the new code as a separate application 
  • Deploy your new microservice as a service or separate project.
  • Test the code to ensure it is correctly functioning.
  • Migrate the data from the legacy app to the new microservice. 
  • Alter your existing legacy application to use the new microservices application.
  • Deploy the altered legacy application
  • Verify that everything works as expected and that you don’t need to roll back to the legacy application.
  • Remove any dead code from the legacy application.

Factors to consider while migrating your existing application to microservices

As you are ready to migrate your monolith architecture to microservices, there are a few facts that you should be aware of during the migration process.

  • Though there are other technologies that are sprouting in the market, Docker and Kubernetes are the most popular technologies to convert your monolith applications into containerized microservices. 
  • Microservice architectures are closely associated with DevOps, i.e., they leverage the benefits of continuous delivery- independently building, deploying, and managing the services.
  • Refactoring the data structures is one of the major problems in adopting microservices. You can follow the tips below for a smooth data refactoring:
  • It is recommended to separate the reference data by separating the data and its services away from the rest of your system, provided if it is independent of the rest of your database. 
  • Incorporating Master Data Management (MDM) eliminates unnecessary duplication.
  • Use a document database like MongoDB or Cloudant to store customer satisfaction surveys, problem tickets, and many more. This will result in much simpler and manageable code. 
  • Check for independent tables so that you can simply split them from the rest of the database. 
  • Select databases depending on the query type that is executed. If it is a complex one, then SQL is advised and if it includes primary queries, then document databases are advisable.
  • Memcache or Redis should be used if you have Blob storage in a relational database. Cloudant or MongoDB is advisable if you are using a structured Java object.
  • If you are aiming for higher customer satisfaction, increased deployment frequency, new releases with lower failure rates, the shorter waiting time between fixes, and faster recovery, then the answer is DevOps methodology that would deliver world-class reliability, security, and stability.
  • You can make infrastructure changes easily, rapidly, securely, and reliably with DevOps tools and processes by treating infrastructure as code.
  • In microservice implementation, the resources of the services provided can be literally anywhere right from virtual machines to a cloud. With this, there are often challenges driven. Therefore, a service mesh is a one-stop solution where every challenge is matched with a generic function provided by the microservice mesh and then addressed.

The demand for a scalable architecture that would quickly adapt to the requirements of the customers strongly influenced the rise of microservices. To offer the best user-experience, FinTech companies started rapid experimenting on various innovative methodologies to implement the best configuration of technologies. But this didn’t stop the challenges from hindering around while migrating from monolithic legacy systems to microservices. 

Challenges that you may face before, during, and after migration

  • Everything isn’t worth migrating. If there are some older applications with old languages and databases, it is recommended to build from scratch rather than migration. 
  • One of the biggest issues is migrating from a single to multiple services as it creates complexity for communication between the services and the ones that don’t share the memory.
  • Migration to microservices causes a cultural shift as the legacy app is around for years. Some of the IT management is reluctant to switch to a new system though, there is a need for a fast, highly-secure, intuitive application. 
  • Before migrating to microservice, check the degree of dependencies. Whether you want all the services to be independent and completely decoupled or you want someone of the components to be shared. A decoupled approach can’t ensure the data stores being synced and consistent. Whereas with the other approach, if a table or a schema is modified, the changes may be reflected in the associated parts. 
  • Though microservices improves agility, they aren’t suitable for all the organizations or applications.
  • As a microservice is independently developed with varying schedules, there is a possibility that the development teams will face a resource conflict resulting in the implementation delay of your cross-microservice functionality.
  • The flow of data in and out of the system is a major factor where the sources of data for each microservice needs to be delineated.
  • If microservice isn’t evaluated and designed correctly, then maintaining the microservice-based application including development, operation, and maintenance will become very pricey.
  • There is a difference between the behavior of microservices and legacy apps. A consistent workload throughout will decide the behavior of the app as multiple services are interconnected in a microservice architecture. 
  • Multiple modules and databases house a lot of connections between them. Therefore, requests, transactions, data management should be handled with care.
  • As compared to the monolith applications, the microservice architecture makes it harder to follow the request through the infrastructure. Moreover, microservice requires its own infrastructure, dedicated CI/CD pipeline, and monitoring processes. Therefore, it becomes difficult when all the teams are involved resulting in wastage of loads of efforts and time.
  • Microservices require proper auditing and tools so that it can get deeper visibility into the computation.
  • New tooling is necessary for operations, diagnostics, and debugging as multiple isolated microservices can be touched by a single computation or request.

Though there are potential disadvantages like operations overhead, mismatch of interfaces, code duplication and so on, the benefits of adopting a microservice architecture outweigh these drawbacks. In the financial services, the success of a fintech app depends on security, speed, and flexibility, and the microservice architecture is capable of delivering all. 

Wrapping it Up!

Every business situation is different. Every FinTech company should consider their situation in terms of requirements, threats, and opportunities before deciding to migrate their FinTech applications. Though migration to microservices has proved to be a boon for some tech giants, it is yet to leave a mark in the financial services. The financial ecosystem always witnesses potential updates. It is correct to say that change is inevitable in financial services and microservices have given the transformative potential for modern FinTech organizations to embrace this change. 

 

Author Bio

Jeevan Babu is a technology enthusiast and strong believer in agile product development. He is a Senior Project Manager at Fortunesoft IT Innovations, a leading custom software development company. A Computer Engineer by education and a technology adherent by passion. His interest in computers & the internet has made him a self-proclaimed geek.

Related Blog

whatsup
close_icon

Fortunesoft

IT Innovations

Hi, there! emoji

How can I help you?

whatsup Start Chat
error: Content is protected !!