Cloud Computing

IBM Research uses AI to automate Mono2Micro application refactoring

Share this post:

IBM Mono2Micro is an AI-driven utility that semi-automatically transforms business-critical applications into microservices. First developed by a multi-disciplinary team of IBM researchers and collaborators from the IBM Cloud Integration team, the IBM Mono2Micro beta was recently included in the Cloud Pak for Applications solution. Now, IBM Mono2Micro application modernization efforts take another step forward with the release of an updated beta version that automatically generates API services and related code to activate Mono2Micro microservice recommendations.

As IBM Mono2Micro matures from an research endeavor to an AI-based, enterprise cloud application modernization utility, we are striving to minimize the need to rewrite code. Ultimately, we envision a scenario in which the solution takes in a monolithic legacy application, creates microservices recommendations automatically, generates the code and deploys across any number of clouds via the Kubernetes-based OpenShift open-source container application platform.

That’s why the latest version of IBM Mono2Micro is engineered to:

  1. create transformational wrappings to turn partition methods into microservices APIs,
  2. provide distributed object management, garbage collection and remote local reference translations similar to the Java remote method invocation mechanism, and
  3. provide pinpointed guidance on what the developers should check, and manually readjust or tweak in the code in the generated microservices.

Elevating beyond ‘lift and shift’

As companies seek to migrate larger portions of their business operations to the cloud, they have found their work is slowed by the challenges of modernizing monolithic enterprise applications — many of which are often mission critical. For large, legacy enterprise applications such as these to operate in the cloud, developers have had to restructure millions of lines of code into smaller functional units called microservices through an expensive, time-consuming, largely manual and often error-prone process known as application refactoring.

Initial attempts at application modernization have largely depended on containerizing the entire application and moving it as a single service onto the cloud, a process often referred to as “lift and shift” that does not scale and is very difficult to administer. The initial IBM Mono2Micro beta version emerged from a proof-of-concept with a major client , which allowed us to validate our research with real data. Our AI algorithm significantly improved in subsequent months thanks to our interactions with clients, their data sets and real-world problems.

IBM Mono2Micro uses data dependencies to find “natural seams” of application refactoring. Data dependencies can take on different forms such as containment, inheritance, object cross-referencing and data type relations. In general, object dependency across independent microservices needs to be either avoided or externally synchronized, which introduces operations and performance issues. An ideally distributed application should minimize such dependencies.

The transformation utility also allows an application’s owner to define their notion of business functionalities or use cases, which influence how AI perceives object/function/code alignment to business context. This not only gives the application owner a clean and intuitive way of directing the AI refactoring outcome, but also helps the learning process by providing explainable outcome back to the owner.

IBM Mono2Micro’s AI-driven approach follows an analytical process and reasoning similar to a human subject matter expert. The system tries to understand the objects and method call correlations and causalities. In addition, IBM Mono2Micro looks at how data dependency influences class relations and implementations, and it examines architectural metrics such as structural modularity, implementation metrics such as microservice API complexity, and operations metrics such as inter-service call volume.

Real-world application

IBM Mono2Micro’s AI takes into account the programming language concepts, an application’s dynamic behaviors at the class, method and data levels, and the business functionalities the application provides. The machine learning algorithms weave together these multi-faceted and highly complex interactions to identify important partitions, based on business function boundaries, program structural modularity and expected operations overhead. The resulting recommendations are nuanced, and the AI explains the intricacies involved in creating microservices that adhere to partitions.

The open-source DayTrader application—which emulates an online stock trading system—offers an example of a monolithic program that IBM Mono2Micro can help break down into microservices for the cloud. DayTrader is a Java Enterprise Edition (J2EE) web application composed of several Java classes, Java Servlets, Java Server Pages, Web Services and Enterprise Java Beans (EJB). The first step in the application refactoring process is to generate runtime call traces under different workloads for DayTrader. Traces capture call dependencies and intensity of such calls across Java classes. Each workload represents an application.

For example, the following figure includes five partitions based on business logic, including ‘trade processor and logic’ (red), ‘database create and update’ (blue) and ‘trade messaging’ (orange). Augmenting data dependencies merged ‘trade processor and logic,’ and ‘database create and update’ partitions due to uncovered data dependency across the classes. The second figure shows the natural seam partitions, where both the partitions ‘trade processor and logic’ and ‘database create and update’ are merged to reduce data dependency.

Edge based and node-based clustering of causal paths to generate microservices

Edge based and node-based clustering of causal paths to generate microservices

The goal is to help clients more effectively automate the refactoring of business-critical applications into microservices that can leverage the cloud’s inherent operational efficiency, economic, agility and security benefits.

We would like to thank the Research team: Nicholas Fuller, Anup Kalia, Liana Lin, Ruchir Puri, John Rofrano, Saurabh Sinha, and Jin Xiao; and our partners at IBM Cloud and Cognitive Software for their contributions in this joint venture.

Distinguished Research Staff Member

Debasish Banerjee

Executive Architect -- IBM Cloud Paks

More Cloud Computing stories

Research Unveils Innovations for IBM’s Cloud for Financial Services

IBM Research played a central role in developing the technology underpinnings of IBM’s financial services public cloud, including the new IBM Cloud Security and Compliance Center, an IBM Cloud service.

Continue reading

Impact of the SQL Relational Model 50 years later

Fifty years ago this month, IBM researcher and computing pioneer Edgar Frank Codd published the seminal paper “A Relational Model of Data for Large Shared Data Banks,” which became the foundation of Structured Query Language (SQL), a language originally built to manage structured data with relational properties. Today SQL is one of the world’s most […]

Continue reading