@@ -14,17 +14,19 @@ Spring Batch 5.1 introduces the following features:
14
14
* <<virtual-threads-support>>
15
15
* <<memory-management-improvement-jpaitemwriter>>
16
16
* <<new-synchronized-decorators>>
17
+ * <<new-cursor-based-mongo-item-reader>>
18
+ * <<bulk-inserts-support-mongo-item-writer>>
17
19
18
20
[[dependencies-upgrade]]
19
21
=== Dependencies upgrade
20
22
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:
22
24
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
28
30
29
31
[[virtual-threads-support]]
30
32
=== Virtual Threads support
@@ -63,3 +65,24 @@ those decorators cannot be used to synchronize access to `ListItemReader#read` o
63
65
64
66
For users convenience, this release introduces new decorators for non-item streams as well. With this new feature, all
65
67
item 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