2021 Call for Code Awards: Live from New York, with SNL’s Colin Jost! Learn more

Back-end portability for cloud-native applications

Many developers fear being locked in to one cloud vendor. All your code might be hosted in one cloud environment and then the pricing structure or another aspect changes and the cloud no longer meets your needs.

Moving workloads between Kubernetes vendors is a necessity for developers working with cloud offerings. But how feasible is it? Exactly how portable are apps in and out of cloud platforms like IBM Cloud? I wondered how this portability would work exactly, so I set out to find some answers.

I found that with Red Hat OpenShift you can use other cloud vendors and port your applications to those new providers in a easier way than I expected. I started with an example healthcare app on Red Hat OpenShift on IBM Cloud and moved to three different other clouds: Rackspace, OpenShift Online, and Scalegrid.

Experimenting with an example health insurance app

The first thing I needed was an application to move around, so I took one of our code patterns: the Example Health use case. Example Health, as the name implies, is an example application for a fictitious healthcare and insurance company. The example use case is composed of three main parts: a user interface (UI), the main Java app itself, and a data source. The following diagram represents the version of the entire application set up on IBM Cloud:


To demonstrate some portability, I took the business logic part of the Example Health code and installed in on a different cloud – I used Red Hat OpenShift Online. (You can get a one month trial here).

As is the case with many applications, the Example Health code requires a data source. Initially, I connected to an existing instance of a MySQL database, but to prove the portability, I copied the database to a hosted service, Scalegrid, (again with a free trial) and pointed the application there.


The last task was to set up the patient UI on yet another OpenShift provider, this time Red Hat OpenShift on IBM Cloud. After deploying the UI, I could connect it to the rest of the application, yielding a result similar to the following screen capture:


Putting it all together

The good folks in my organization created the Example Health application to showcase several technologies and practices. One of the abilities we wanted to demonstrate with Example Health is switching data sources on the fly. When you first open the patient UI part of the application, by default it uses canned responses, but you can integrate it with a z/OS database through API Connect or with Java Liberty on OpenShift, as demonstrated in the previous section. To specify either one, select the settings tab in the UI:


Switching between back ends demonstrates an architecture more like the following diagram:



These examples showed how to port the services of an example application completely on and off IBM Cloud. The Example Health sample code also includes a few more user interfaces. You can experiment placing each of them on other cloud providers.