Spring Batch 5.0 -How it is changing the batch processing game?
2 min readDec 23, 2022
First off, what is Spring Batch? Let’s cover that quickly:
“Spring Batch is an enterprise-specific, batch processing framework (Batch processing is the method computers use to periodically complete high-volume, repetitive data jobs) to allow the development of highly robust and reliable systems whether in a distributed or monolithic set of systems.”
Now that we have got that covered, let’s have a quick glance at how does Batch achieves this (the below details are referenced from a great resource on Spring Batch at livebook.manning.com):
- Transaction management: TM affects the reliability and robustness of Spring Batch jobs. Usually, in a request-response driven system this is achieved by programmatic transaction demarcations or declarative transaction management. The same problem of ACID turns out to be complicated for Batch processing systems.
- Chunk based processing: Chunk based processing refers to aggregating and transforming a subset of data so that they can be processed later on. With the onset of Spring Batch v2.0, there are two options of these subset of dataset: Tasklets and chunk processings. Baeldung has a really great explanation for the same.
- Declarative I/O: Declarative I/O is a methodology to abstract away the I/O flow logic required for Batch to take input and output the desired outcome. Declarative programming is a high-level programming concept, which is the opposite of imperative programming.
- Start/Stop/Restart/Retry/Skip: Batch also offers mechanisms to start/stop or restart a job. A batch job needs to be: Robust, Traceable and Restartable. This allows the batch jobs to be bulletproof to: non-fatal exception, transient exceptions, an execution failure and much more.
- Web based administration interface (Spring Cloud Data Flow): Spring Cloud Data Flow provides tools to create complex topologies for streaming and batch data pipelines. The data pipelines consist of Spring Boot apps, built using the Spring Cloud Stream or Spring Cloud Task microservice frameworks.