Why this matters
- Loading a publisher's catalog CSV with 500,000 titles through a REST endpoint would time out and exhaust memory — batch jobs handle volume outside the request path.
- Chunk-oriented processing commits after every N items: a crash at item 47,000 resumes at chunk 47, not item 1.
- Spring Batch tracks job and step execution metadata in a database, giving you restartability, auditing, and skip/retry policies for poison records.
Chunk-oriented processing
L1 · FresherRead-process-write in chunks balances memory and transaction size for large BookStore imports.
Job repository
L2 · IntermediateSpring Batch tracks job execution metadata — enables restart after failure from last committed chunk.
Idempotent writers
L3 · AdvancedDesign writers so reruns do not duplicate rows when jobs retry after crashes.
Batch vs streaming
L4 · ExpertUse Kafka streams or Flink when near-real-time is required; Batch for nightly ETL and reconciliation.
Transaction proxy
BEGIN transaction
bookService.placeOrder()Your code
COMMIT or ROLLBACK
Batch domain vocabulary
Job— the top-level unit of work, e.g.importPublisherCatalogJob.Step— one phase of a job: read, process, write in chunks.ItemReader— pulls input records one at a time (CSV, JDBC, JPA).ItemProcessor— transforms or validates each item; returnnullto filter out.ItemWriter— persists a chunk of processed items in one transaction.JobRepository— stores execution state for restart and monitoring.
Dependencies and job metadata
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
</dependency>
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 2 sections
- CSV catalog import job
- Trigger and monitor jobs
Test yourself
Answer these before moving on — recall is what makes it stick.