X

The latest cloud infrastructure announcements, technical solutions, and enterprise cloud insights.

Transform monolithic Java Apps to microservices on Oracle Cloud Infrastructure

Robert Ronan
Principal Product Manager

Legacy software applications are difficult to modernize. Enterprises rely on these monolithic apps to power their businesses but face an urgent mandate to move to the cloud and adopt a cloud native architecture. This blog walks you through how vFunction automates and accelerates the application modernization process on Oracle Cloud Infrastructure (OCI).

The following sections track the process of refactoring and modernizing the MedRec application. MedRec, also known as Avitek Medical Records, is a monolithic Java EE application that ships with the WebLogic server. We describe the process to refactor MedRec into microservices and deploy it as a new microservices-based application on the Oracle Container Engine for Kubernetes (OKE), but you can access the full tutorial online.

Key concepts in Java application refactoring

The key goal in refactoring the MedRec application is to identify the services to extract from the monolith, their interfaces, and the classes included in their scope. Following this analysis, we can extract each service to develop and deploy it separately on a Kubernetes cluster, such as OKE, using Oracle’s tooling to create WebLogic based docker containers. The vFunction process follows three steps that accelerate the application modernization process, using intelligent automation that observes actual business domain flows and replaces months of manual work and tedious modernization labs.

Learning and assessment

vFunction dynamic analysis observes the actual MedRec business flows and behaviors through a JVM agent. Then it applies static analysis of the bytecode for static dependencies and ensures code coverage. As shown in the following graphic, an initial application migration assessment report measures application complexity across five dimensions, specifies the set of initial services that vFunction has identified, and related classes, API end points, and exclusivity calculations.

A graphic depicting the MedRec Assessment Report with summary.

The following video introduces the MedRec analysis and discusses several key refactoring concepts including service exclusivity, infrastructure classes, and entry points.

The vFunction agent acts much like an application performance monitoring (APM) agent but at a much deeper analytical level. It samples the running threads 100 times a second, tracks call stacks and CPU usage of each function, and tags memory that might make splitting up services difficult, including static memory, Spring Beans, sockets, file handles, locks and synchronization objects, database table access, and more. Static code analysis is then applied to account for compile-time dependencies of the dynamic classes to supplement the dynamic data, minimize configuration, assess coverage, and cross-check dynamic usage for dead code analysis.

Analysis and automation

When the learning and assessment phase is completed, vFunction presents the analysis to the architect in an interactive console that provides an initial service topology and detailed visibility into all related interdependencies that might need refinement by the architect. The next video in the MedRec analysis walks you through the vFunction user interface and reviews the initial results, interactions, and recommendations.

As an architect, augmented by the vFunction UI, you have the power to apply your perspective and refinement to the system recommendations. In the MedRec application example, the next step in the process is to begin to further consolidate the services and maximize service exclusivity based on vFunction’s initial decomposition. These next steps show how vFunction takes an architect from an initial service topology to a final simplified microservice architecture of five services and a common library using best practices including merging services, creating API endpoints, and building a common services library.

First, create a singular chat function for the MedRec application. The following short video demonstrates how to merge services, explore dynamic class exclusivity, create API entry points, and rename a new complete microservice as DrPatientChat, which is 100% exclusive.

Next, the MedRec analysis focuses on creating a single search microservice by investigating static classes that are identified as nonexclusive, marking them as infrastructure classes, and assigning them to a common library. The following video tracks that process: Merging two search services into one, identifying common resources, and renaming the consolidated new microservice as PatientSearch.

The next video illustrates best practices for ensuring a clean common library by identifying non-foundational classes in the common jar and ways to reduce the scope of a service by ignoring redundant classes that then yield a minimal context.

The final video showcases the remaining steps to create a microservice architecture, consisting of five services for chat, search, authentication, record management, and registration.

Service extraction and OCI deployment

From the vFunction UI, you can select which services to extract, and the system creates a set of Service Specification JSON files. A vFunction code-copy utility references that file, pulls from the necessary source code, and creates a POM file to use with Maven to build the new service. To deploy on Kubernetes and OCI, vFunction uses WebLogic Server Deploy Tooling and the WebLogic Image Tool. You also need the following prerequisites:

  • A running service instance of Oracle Container Engine for Kubernetes (OKE) cluster

  • Familiarity with kubectl

  • Access to Helm

  • WebLogic Kubernetes operator installed on the cluster

  • Ingress controller (operator) installed on the cluster (currently supports Nginx and Traefik)

  • An Oracle account with permissions to download WebLogic base docker images

  • A docker repository to upload all images that are created during the process

You can find further installation and testing details on vFunction's site.

Conclusion

You can modernize monolithic Java applications quickly and migrate confidently to the cloud with the vFunction platform, using a low-risk approach that results in high value. The approach used in this blog allows the enterprise application to access all the services and advantages of a cloud native application available on OCI, from increased elasticity and scalability, faster release cycles, modern developer services, and rising productivity and business agility.

For more information, see the Oracle Container Engine for Kubernetes documentation and the vFunction website. If you want to experience vFunction on Container Engine for Kubernetes for yourself, sign up for an Oracle Cloud Infrastructure account and start testing today!

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha