What is the difference between chunk size and partition size in spring batch?
I am not referring to spring batch partitioning which is explained briefly here.
I am referring to DEFAULT_PARTITION_SIZE which is also supported by spring batch.
I am setting the value of this property as below -
jobExecution.getExecutionContext().put(
"DEFAULT_PARTITION_SIZE",
300
);
For my project I have chunk size of 25 and partition size of 300. I want to know what is the difference between these two. I understand Chunk Size refers to reading the data one at a time and creating 'chunks' that are written out within a transaction boundary. But there is not much explanation for Partition size in spring batch docs or on internet.
With chunk size of 25 and partition size of 300, i was expecting that 25 records would be written to the output file in each go. But in actual 300 records are getting written to output file in each go. why is this.
From this link and documentation, it seems that chunk Size dictates the number of items processed before committing a batch. If set to 25, the reader reads 25 items, the processor processes them, and then the writer writes those 25 items in one transaction. while the DEFAULT_PARTITION_SIZE seems to be a custom or less-documented parameter, likely dictating how many records are in a single partition. If set to 300, each partition would comprise 300 records. You can try ask in aws batch support form, if you are sure it doesn't appear there