Digital Developer Conference: Cloud Security 2021 -- Build the skills to secure your cloud and data Register free

Overview of the sample app

To help you learn how to modernize your applications, I’ve published a sample application that will let you modernize a legacy Java EE application with cloud-native technologies that uses modern Java runtimes. Whereas the legacy app was deployed to WebSphere Application Server traditional, the modernized app is built with Open Liberty (a Jakarta EE and MicroProfile compatible implementation) and deployed and operated on Red Hat OpenShift, the enterprise distribution of Kubernetes.

This sample application, a simple e-commerce app, will help you apply the application modernization strategies and realize the benefits of modernizing your applications.

Architecture of legacy application

The sample application was built back in 2008 using a typical 3-tier architecture.

It was a Java EE 6 app that ran on WebSphere Application Server traditional, version 8.5.5, and was deployed to 2 virtual machines.

It was built with EJBs and REST APIs, using the Backends for Frontends pattern not the RESTful API pattern.

The sample application essentially had 3 monoliths: a monolithic Db2 database, a monolithic backend (WebSphere Application Server), and a monolithic frontend (built with the Dojo toolkit). The following architecture diagram shows this 3-tier architecture of the 3 monoliths running in the virtual machines.

Architecture of legacy sample app

In this sample e-commerce app, you can navigate through products in a catalog using a set of categories. Then, you can select a product and add it to your shopping cart.

UI of the legacy sample app

Architecture of modernized app

I started to modernize the sample application back in the summer of 2020.

The modernized app is a cloud-native, microservices-based application that uses Open J9 and Open Liberty (Jakarta EE, MicroProfile). A version using Quarkus is also available.

It is deployed to Red Hat OpenShift in multiple containers: Quarkus or Open Liberty backend, Quarkus Catalog service, micro frontends (navigator, catalog, account, order, shell, and messaging), remaining monolith DB (Db2), Kafka, and Postgres (catalog DB). The following simplified architecture diagram shows the micro frontends, the microservices, and the remaining monolith running in containers deployed on Red Hat OpenShift.

Architecture of the modernized app

The new modernized web application supports the same functionality as the legacy one. For this application modernization effort, the goal was not to improve the UI but instead to modularize the UI to be able to update micro-frontends independently from each other.

UI of the modernized app

The following illustration shows the breakdown of the micro-frontends.

Micro-frontends of the modernized app

Results of the modernized app

If we look at the modernized app running in Red Hat OpenShift Container Platform, you can see that you can deploy new functionality separately from each other. For example, let’s say that you want to add ratings to the products. You don’t have to touch the remaining monolith and just change everything in the different components:

  • Database of catalog service (Postgres)
  • Catalog microservice
  • Catalog micro frontend

Results of modernizing app in Red Hat OpenShift Container Platform

Summary and next steps

Now that you have an understanding of the architecture of the legacy sample application, and an understanding of the architecture of the modernized sample application, watch the following video to review a typical application modernization journey of modernizing just your runtime, modernizing your runtime and operations, or modernizing your architecture, runtime, and operations:

Then, you can complete these tutorials in this learning path that show you how to take baby steps in modernizing your legacy applications:

  • Containerize your application
  • Modernize your application runtimes
  • Refactor your monoliths to microservices using the Strangler pattern
  • Separate the frontend and develop micro frontends
Legend