================ Spring Batch ================ => Spring Batch is a lightweight and powerful framework for processing large volumes of data. => It is robust framework designed for building batch processing applications in Java. ========================== What Is Batch Processing? ========================== Batch processing involves executing a series of automated jobs, it involves: 1) Reading large amounts of data. 2) Processing data in chunks. 3) Writing the processed data somewhere (like a database, file, etc.). ====================================== Batch Processing Real-time Usecases ====================================== - bulk msg - bulk email - processing file with millions of records - sending salaries for the emps (payroll systems) - sending bank acc stmt to acc holders - sending post paid bill reports - sending payment reminder notifications - Generating reports - Data migration between databases. ================================== Spring Batch Module Key Concepts ================================== 1) ItemReader 2) ItemProcessor 3) ItemWriter 4) Step 5) JOB 6) JobRepository 7) JobLauncher ItemReader : It is used to read data from the source ItemProcessor : It is used to process the data ItemWriter : It is used to write the data to destination Step : It represents sequence of our batch execution (reader + processor + writer) Job : It is used to represents set of steps for batch processing JobRepository : To maintains job execution history and steps info JobLauncher: It is used to start the job exeuction. ============ Batch Flow ============= Request ==> RestController ===> Job Launcher ==> Job ==> Step ==> (reader + processor + wrriter) Note-1: Once job is executed we can csv file data inserted into DB table. Note-2: Batch Execution details and Step execution details also we can find in DB tables. // sql quries show tables; select * from people; select * from batch_job_execution; select * from batch_step_execution; ======================================================== Spring Batch Tutorial : https://youtu.be/2sdY-fKaR2o Spring Doc: https://spring.io/guides/gs/batch-processing ========================================================