Friday, June 12, 2015

Spring Batch Introduction

Coding with Spring has always been like a breeze. With Spring  Batch, we go a notch higher. Remember batch processing of the old, where we would wait for considerable time to get the results back. Spring batch mimics same behavior.

Target Applications


It is preferred in applications which are time intensive such as computing multi-carlo simulations on the grid. This computation takes time and a lot of such computations takes places in parallel. So it's better to define steps which will be executed one after the other. Following steps will wait for hours if required, if the previous steps are not completed.

It is used in batch applications which process large volume of records. Inherent support is provided for job start/stop/restart, transaction management, logging, job statistics among others. Minimal code needs to be written. Spring Batch takes care of most of the things. High-volume and complex batch processes can take advantage of Spring batch.

Billions of Computations in a application I worked on


Such applications proceed in an automated manner without user involvement. One such application that I worked on was to calculate month end risk numbers via multi-carlo simulations. Billions of computation used to take place in a single batch (computations used to run on Grid of computers). The repetitive steps used to wait on external system which used to send inputs on JMS. The results of Grid were then bundled up with inputs from external systems and output was generated.

Open Source


Spring Batch is open source framework. It is very helpful for people from Spring background. A couple of hours tutorial and viola, a Batch routine is ready. With Spring Batch, we can leverage other Spring tools like Spring-JMS, Spring File-IO services etc.

Typical Batch Scenario

A typical batch scenario comprises of the following steps.


Spring batch provides robust, enterprise scale solution to automate these steps so as no user effort is required during processing.



No comments:

Post a Comment