@@ -14,17 +14,19 @@ Spring Batch 5.1 introduces the following features:
1414* <<virtual-threads-support>>
1515* <<memory-management-improvement-jpaitemwriter>>
1616* <<new-synchronized-decorators>>
17+ * <<new-cursor-based-mongo-item-reader>>
18+ * <<bulk-inserts-support-mongo-item-writer>>
1719
1820[[dependencies-upgrade]]
1921=== Dependencies upgrade
2022
21- In this release, the Spring dependencies are updated to the following versions:
23+ In this release, the Spring dependencies are upgraded to the following versions:
2224
23- * Spring Framework 6.1.0-M2
24- * Spring Integration 6.2.0-M1
25- * Spring Data 3.2.0-M1
26- * Spring LDAP 3.2.0-M1
27- * Micrometer 1.12.0-M1
25+ * Spring Framework 6.1.0-M4
26+ * Spring Integration 6.2.0-M2
27+ * Spring Data 3.2.0-M2
28+ * Spring LDAP 3.2.0-M2
29+ * Micrometer 1.12.0-M2
2830
2931[[virtual-threads-support]]
3032=== Virtual Threads support
@@ -63,3 +65,24 @@ those decorators cannot be used to synchronize access to `ListItemReader#read` o
6365
6466For users convenience, this release introduces new decorators for non-item streams as well. With this new feature, all
6567item readers and writers in Spring Batch can now be synchronized without having to write custom decorators.
68+
69+ [[new-cursor-based-mongo-item-reader]]
70+ === New Cursor-based MongoItemReader
71+
72+ Up to version 5.0, the `MongoItemReader` provided by Spring Batch used pagination, which is based on MongoDB's `skip` operation.
73+ While this works well for small/medium data sets, it starts to perform poorly with large data sets.
74+
75+ This release introduces the `MongoCursorItemReader`, a new cursor-based item reader for MongoDB. This implementation
76+ uses cursors instead paging to read data from MongoDB, which improves the performance of reads on large collections.
77+ For consistency with other cursor/paging readers, the current `MongoItemReader` has been renamed to `MongoPagingItemReader`.
78+
79+ [[bulk-inserts-support-mongo-item-writer]]
80+ === Bulk inserts support in MongoItemWriter
81+
82+ Up to version 5.0, the `MongoItemWriter` supported two operations: `upsert` and `delete`. While the `upsert`
83+ operation works well for both inserts and updates, it does not perform well for items that are known to be new
84+ in the target collection.
85+
86+ Similar to the `persist` and `merge` operations in the `JpaItemWriter`, this release adds a new operation named
87+ `insert` in the `MongoItemWriter`, which is designed for bulk inserts. This new option performs better than
88+ `upsert` for new items as it does not require an additional lookup to check if items already exist in the target collection.
0 commit comments