From the course: Spring: Spring Batch

Batch processing concepts

From the course: Spring: Spring Batch

Start my 1-month free trial

Batch processing concepts

- [Narrator] Before diving in to Spring Batch. Let's review some of the basics of batch processing. We'll talk about what batch processing is. It's characteristics. And discuss some examples. If you ask most people to describe their company's payroll system, they will most likely describe something like the image we see here. These users are accustom to interacting with the user interface that accepts their time entries in real time. More technical individuals may describe entering their time through a browser based web application that stores their entries in to a database. What people forget to mention, is the Batch Job that runs periodically behind the scenes to process their bi-weekly or monthly time sheets allowing them to get paid. This behind the scenes process is essential for ensuring time entries are processed. And their wages are ultimately deposited in to their bank accounts. Many industries execute these background processes to complete essential business operations such as, billing, transactions, statements and reporting. In this course we will dive in to how to build similar batch processes with Spring Batch on the JBM. Batch processing has some key characteristics that set it apart from other types of technical solutions. Such as, web or desktop applications. Unlike a web or desktop application, there is no human interaction with a batch job. So there's no GUI. Instead, they run behind the scenes on their own as a process without interruption. Batch jobs follow a typical pattern. They consist of reading from a fixed data set, like our time entries. And then processing each item in the data set until it reaches the end. The processing that occurs for each item varies for each batch job and the business operation it's meant to complete. It is common to execute batch jobs on a schedule. Allowing the necessary data to accumulate over a period of time between executions. Once we have the necessary data for the period, the job is triggered to perform the processing. Let's take a look at some typical batch scenarios to get a better understanding. Reporting is a frequent use case for Batch. Because it requires a set of data to be collected over a reporting period. And possibly aggregated as a complete data set. In order to process and distribute report information to it's recipients at the specified interval. The batch job requires all data to be present in order to create the report. Imagine if you're monthly bank statement were not batch processed. In a real-time scenario you're statement would either be incomplete for the month or sent too frequently to provide value. You wouldn't want to receive a statement every time you made a transaction. It's much easier to digest this information on a monthly basis. This makes Batch an ideal approach for reporting scenarios. Another frequent use case is the exchange of information between systems or within the same system. Batch jobs can generate information to be sent to another system or receive information from another system for processing. This will typically take place using a pre-defined integration strategy between the two systems. Such as, SFTP, direct database connections or messaging. These integration strategies can require careful timing to ensure data is available and up to date when necessary. Batch jobs of this nature typically follow an ETL pattern. Receiving the data, validating it, possibly transforming it and then loading in to another data store. So that is a quick look at Batch processing in a few examples. Throughout the course we will see how to construct batch jobs with Spring Batch that can perform the processing necessary to power business operations for major enterprises.

Contents