Refactoring Enhanced

HyperBatch vs. Code Refactoring

Refactoring

Refactoring involves the conversion of applications from the mainframe to a cloud-based environment such as Amazon Web Service (AWS). Converting COBOL to Java code is at the core of these solutions and, for the most part, is an automated process—its strongest value proposition. In general, refactoring generates more lines of code, with more complexity than the original programs. The business logic is duplicated, not streamlined within the target system. This is acceptable for a majority of the applications being transformed. However, when utilizing automated refactoring tools to transform batch processes, the resulting code in most cases severely underperforms the original. The “duplicated” business logic is sub-optimal in the new domain. Even manually rewriting the code post-conversion does not solve this problem. Code complexity may be reduced in a rewrite, but the performance is still dramatically compromised over the original mainframe system. Moreover, all sorting functions in the original mainframe system persist in the refactored system, further reducing the performance. Batch applications that process billions of rows that originally took several hours to complete on the mainframe now take days of sorting and processing on the refactored systems.

So where does refactoring make sense?

Refactoring’s major benefit is the time it takes to perform the conversion given the level of automation. For non-batch processes, this is quite often a very good solution: it makes good business sense when there isn’t an immediate need to advance the application’s functionality.

Post-conversion, the cost of maintaining the new system is likely to increase, albeit with less risk, given the reduced reliance on dwindling COBOL resources—another key benefit. Further modernization initiatives may require a significant effort to decipher the newly translated code and modify the underlying systems architecture to better serve future business goals. This may be completely acceptable—and it often is, given the growing need to divest from a COBOL code base.

Many of refactoring vendors also provide additional solutions through their analysis tools and file conversion capabilities. Understanding dependencies across a very complex undocumented mainframe environment is extremely valuable. Converting mainframe file structures into formats that are readily understood in non-mainframe, cloud-based environments is also beneficial.

The HyperBatch Difference

KeyGen Data’s HyperBatch process isn’t an automated refactoring solution. HyperBatch is a recently patented algorithm singularly focused on optimizing batch processes. Not only does the HyperBatch method dramatically enhance the transactional processing speed of the batch, but it also removes the significant time and cost overhead associated with sorting—the algorithm combines the two tasks into a single optimized process.

Performance gains can be substantial, over 20 times faster than the mainframe and 100 times faster than non-mainframe or refactored solutions. The more complex the original batch process, the higher the gains demonstrated. As a reference, KeyGen Data’s benchmark tests modeled the production of common credit card statements with 1 billion rows of batch records. The test resulted in the batch process being completed in under seven (7) minutes. On a mainframe, this same batch process would have taken several hours.

Since the HyperBatch method is not accomplished via an automated process, the solution does require coding as part of the implementation; however, the resulting code is typically 70–80% more lightweight than the original and very easy to maintain. Therefore, the cost of conversion is greater than purely taking an automated refactoring approach. Arguably, the final state more than justifies the conversion cost given the material gains in performance, substantially lower operating costs, greater ease of code maintenance, better utilization of available resources, and a stronger framework for future modernizations.

Final thoughts

In general, the KeyGen Data HyperBatch solution is not a replacement for automated refactoring; these tools do an admirable job of addressing a very critical need. Instead, the HyperBatch methodology was developed to address underperforming batch processes in the cloud, as refactoring quite often fails to achieve acceptable results. In terms of scope, utilization of the mainframe for batch processing is estimated at 40–60% of the compute resources. This presents a major challenge for a full commitment to cloud migration efforts. In many cases, the batch process—given its significant footprint on the mainframe—hinders the modernization objectives as batch and non-batch data are becoming increasingly intertwined.

The test was performed using a batch process similar to a bank statement reconciliation process, in which a transaction file with credits and debits updates a master file. The application on the mainframe was written in COBOL and was run on an IBM Model BC12 (2828-H06). The same logic was implemented utilizing the HyperBatch method processed within an AWS cloud environment. As HyperBatch is a process methodology, the same test could have been run in an Azure or Google Cloud environment—or on premise if required.