IBM Mono2Micro overview
IBM® Mono2Micro™ is an AI-based, semi-automated, utility for refactoring Java® monolithic applications into microservices that you run on WebSphere® Application Server Liberty or Open Liberty. You can use IBM Mono2Micro and the recommendations that it provides to automatically generate a significant portion of code that you need to build and deploy your microservices.
Through static and dynamic analysis, IBM Mono2Micro uses its machine learning engine and an analysis of the Java monolithic application code to generate partition recommendations. Partition recommendations are groupings of classes in the monolith that can serve as starting points for microservices. The recommended partitions along with other pertinent information are displayed in an intuitive workbench UI. Based on its built-in knowledge about the Java programming language, IBM Mono2Micro also provides a deep semantic analysis of class-to-class invocations. By using the workbench UI and the detailed analysis, you get a clear picture of the partitioning recommendations, which you can iteratively fine-tune to suit your business needs. After you decide on a specific partitioning recommendation, you can run IBM Mono2Micro to automatically generate a significant portion of code that you need to build and deploy the recommended partitions along with your existing monolith code. After you review the generated code, you can continue to iteratively fine-tune recommendations and generate code until you have the microservices that you want. You can then run the microservices on WebSphere Application Server Liberty or Open Liberty.
IBM Mono2Micro is available as part of IBM WebSphere Hybrid Edition and IBM Cloud Pak® for Applications.
The IBM Mono2Micro journey
IBM Mono2Micro commands provide the following capabilities.
How it works
The following figure displays the workflow through IBM Mono2Micro. The blue boxes, which begin with the term
(Action)
, represent user actions. The unfilled boxes, which begin with the term
(File)
, represent files. The solid lines point to the next steps. The dashed lines
show the uses of files and point to the next user actions or files in the workflow. The workflow
starts with application code and, after analysis and code generation, ends with generated starter
code for partitions.
IBM Mono2Micro components
IBM Mono2Micro consists of the following six components, which are displayed in the previous figure.
- Code analyzer (
mono2micro-bluejay
container or binary analyzer .jar) - The mono2micro analyze command that analyzes and optionally instruments the Java code of monolithic applications.
- Binary instrumenter (minerva-agent-1.0.jar)
- A Java agent that instruments a running application deployed on the application server.
- Use case recorder (Flicker)
- Run with the mono2micro usecase command, a Java program that records use case names and times. Use it when you run test suites or test cases corresponding to various business use cases of a Java monolithic application.
- The AI engine for partition recommendations (
mono2micro-aipl
container) - The mono2micro recommend command runs the AI engine of IBM Mono2Micro. It uses machine learning techniques on the user supplied runtime traces and metadata that is obtained from the source code analyzer. It uses the resulting information to generate partition recommendations that eventually can become microservices. This command also produces a detailed report for the recommended partitions.
- IBM Mono2Micro workbench UI
- The
mono2micro-ui
container that displays the recommendations from the AI engine when launched with the mono2micro workbench command. The recommendations that are obtained from the IBM Mono2Micro AI engine are kept in your local storage. You can load the recommendations in the workbench UI to display them in a graphical visualizer. With the UI, you can modify the AI-generated partition recommendations. - Code generator (
mono2micro-cardinal
container) -
The mono2micro transform command invokes the code generator, which has deep knowledge of the semantics of the Java programming language. The code generator uses the recommendations from the AI engine to do the following things:
- Provide detailed invocation analyses of the recommended partitions that can eventually be implemented as microservices.
- Generate detailed inheritance analyses of the recommended partitions.
- Generate a significant portion of the code needed to realize the recommended partitions in containers.
You can download the Mono2Micro tools and run them on your local computer.
Steps for refactoring a Java monolithic application
The following steps describe how to refactor a Java monolithic application by using IBM Mono2Micro. They are a more detailed version of the previous figure.
Some of the previous steps are explained in detail in other IBM Mono2Micro topics.
- Installing IBM Mono2Micro includes operational aspects of IBM Mono2Micro from the viewpoint of a user, including resource requirements.
- Collecting data about Java monolithic applications details the necessary steps and relevant information to complete steps 2a and 2b.
- Getting partition recommendations discusses how to run steps 2c and 2d, and if necessary, step 3.
- Viewing microservice recommendations details step 2d, including how to interpret and customize the IBM Mono2Micro generated microservice recommendations.
- Reports include more information about the partition and inheritance analysis reports produced in steps 2d and 3.
- Generating starter code for microservices details step 4a for automatically generating microservice code.