Woke up Sunday morning wondering how easy would it be to refactor an IBM Mainframe application to Pivotal Cloud Foundry. This is what happened.
Prerequisites: Heirloom Account and a Pivotal Account. Let's assume that you've taken the steps to download & install the Heirloom SDK and Pivotal's CLI tool.
Here's how it's done. Recompile, package, deploy, execute, debug.
Recompiling the COBOL/CICS application into a Java .war package
STEP 1: Create a new project in the Heirloom SDK using the built-in "account" application. As soon as the project is created, it will automatically be compiled into 100% Java (this literally takes way less than 10 seconds), ready for deployment to any industry-standard Java Application Server (such as Apache Tomcat).
STEP 2: Configure the deployment project. This is where we set up deployment information that tells the application things like how transactions ID's relate to programs, and where the database is.
STEP 3: Package the application as a .war file -- this is done using the "Export Wizard" (again, this literally takes way less than 10 seconds). We now have an "account.war" package that contains everything we need to execute the application in exactly the same way as it used to run on the Mainframe. Only now, we can pretty much deploy it anywhere we choose. I've got an idea! Let's try Pivotal Cloud Foundry. (This is pretty much the thought I woke up with this fine Californian Sunday morning.)
Deploy, Execute & Debug ... Pivotal Cloud Foundry (PCF)
STEP 1: Deploy. Enough of the GUI wizardry, time for some CLI magic. Having already signed into the Pivotal account using the CLI, we can now deploy.
$ cf push heirloom -p account.war
Yep, that was pretty much it. PCF is doing a chunk of work behind the CLI to create a Java and Apache Tomcat environment, followed by the deployment of the "account.war" package.
STEP 2: Execute. In the Pivotal Web Services Console, we can see it has provided us with a URL for the deployed application.
Clicking on the URL, and ...
... enter 1, and ...
Wondering about the date/time? It's Sunday 7th April in California, just after 7 pm as I write this, but the Pivotal instance is running on UTC time.
A confession -- the database is actually hosted in Amazon RDS. It was already there before I started, and frankly I've got better things to do with my Sunday than to satisfy my (near uncontrollable) OCD and replicate a perfectly serviceable database in PCF. Like tending to my neglected hanging basket, and discovering that I'm going to be a foster parent, again.
Actually, if you didn't already know, PCF is a truly multi-cloud platform. I could have easily setup an Amazon RDS database in PCF.
STEP 3: Debug
Sometimes things don't go as planned, so let's take a quick look at how we can debug an Heirloom application deployed to PCF. The first thing we need to do is tell PCF that we want to switch to "debug mode".
$ cf set-env heirloom JBP_CONFIG_DEBUG '{enabled: true}' $ cf push heirloom -p account.war $ cf ssh -N -T -L 8000:localhost:8000 heirloom
Then setup a local debug configuration in the Heirloom SDK, and click "Debug".
Now we're all set. If we go back to the browser and initiate the application again, the debug session will start at the first breakpoint encountered. Here we have set the breakpoint on the first line that is going to display the application's menu.
Some Observations
Horizontal Trumps Vertical. See that "SCALE" button? It basically means that this Mainframe COBOL/CICS application is no longer constrained to a vertically scaled infrastructure. It can now scale horizontally, and dynamically (based on load), and is highly-available when deployed across multiple zones. With climate change, cyber attacks and dramatically increasing transactional loads, the simple conclusion is that the cloud is way more resilient than traditional big-iron data-centers (Amazon for example, has 57 data-centers in 19 global regions). How scalable? Here's a showcase we did for Amazon AWS that scaled to 15,200 MIPS. Mainframe vs. Cloud? The Cloud wins. Big.
Refactoring Trumps Rehosting/Rengineering. Heirloom is an automatic refactoring solution. What that means is that not only does it deliver the table-stakes benefits of rehosting (retention of existing function & behavior, 80% reduction in operating cost), but the modernized workloads are cloud-native, leverage open source containers (instead of vendor proprietary containers that were first delivered 20 years ago during the client/server heyday), and because all the business rules are automatically exposed as web services, you can do some amazing things with them (all without changing the original application code). Get Alexa to call a CICS transaction. Refactor a CICS transaction to a microservice. Deploy to PCF in a few minutes. Oh, I didn't mention reengineering (you know... analyze, extract business rules, generate a low-fidelity version of the original application, test test test, try again, ...). It takes a year (at least), just to get something that kinda works (and you don't understand).
Agility Trumps Everything. Why? Because the Financial Services industry is under immense pressure to compete with the emerging digital FinTech wave, and Government is imploding under the weight of technical debt. Neither of those markets are being served well by established vendors/partners. Overly dramatic? If you're in either of those arenas, you don't need me to make the case -- you're already living with the brutal reality of minimal returns on huge multi-year investments. There is a better way.
Enterprise Architect at Canadian Tire Corporation
5 年Hi Gary,? Could Heirloom technology be used to modernize PLI/IMS applications?? ?Thanks, Sun