Batch Processing with Spring Batch


What is Batch Processing
  • Runs as a process without human intervention
  • Runs as a background process
  • The input is fixed: Can be service calls, files from a location, db entries etc
  • Scheduled at a particular time

Examples of where Batch Processing can be useful:
  • End of Day Balance Sheet Reporting
  • Weekly reporting
  • Monthly reporting
  • Yearly reporting.. and so on
  • Credit Card Statements
  • Synchronizing between two systems (source and target)
Jobs should be scheduled according to Business Requirements.

Why use Spring Batch with Java?

Spring Batch is the de facto standard for batch processing on the JVM. Its implementation of common batch patterns, such as chunk-based processing and partitioning, lets you create high-performing, scalable batch applications that are resilient enough for your most mission-critical processes. Spring Boot provides an additional level of production-grade features to let you speed up the development of your batch processes.

Batch processing fits perfectly with cloud computing, and Infrastructure as a Service (IaaS), in particular. The ability to run applications in an on-demand, elastically scalable, and fault-tolerant manner are all cloud features that Spring Batch can use.

Spring Batch’s integration with other Spring APIs lets you be productive from day one. With ItemReader and ItemWriter support for files, relational databases and NoSQL stores support via Spring Data and messaging support through Apache Kafka and RabbitMQ, Spring Batch has the ability to handle most use cases out of the box.


Comments

PD said…
This comment has been removed by the author.
PD said…
Interesting. Similar to cron jobs, which other possible ways one can achieve batch processing? A case study would be useful to understand.
Richa Vaidya said…
Yes, similar to cron jobs. Spring Batch is an excellent framework to design Batch Processing in Java.

Will try to present a case study on the subject, or atleast a few detailed examples.

Popular posts from this blog

Writing your own ejabberd Module

npm ECONNREFUSED error

Conditional Flow - Spring Batch Part 6