@procedures/mongo 0.48.0 → 0.48.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @procedures/mongo
2
2
 
3
+ ## 0.48.2
4
+
5
+ ### Patch Changes
6
+
7
+ - aa4ce41: `MongoDocumentStorage`: a plain write of a new id does not fail when another process writes that id at the same time. Before this fix, `set`, `setBatch` or `patch` could reject with a duplicate key, and the store kept the value of the other process. A batch also did not make the writes after the stopped write. The write tries again with the same number, so a reader does not pass it. A write with a guard keeps its conflict error. A real duplicate reaches the caller after one more try.
8
+ - 08beec5: A write that a write in flight holds back reaches its subscribers with no later write. `StorageChanges` has a new optional field `held`. The docs state that a result gives each write at least one time. They name the two cases of a second time. A read of the log with no change does not move the `since` of the next event, so the events keep their chain.
9
+ - Updated dependencies [08beec5]
10
+ - Updated dependencies [48b7127]
11
+ - Updated dependencies [9541575]
12
+ - @procedures/client@0.48.2
13
+ - @procedures/collections@0.48.2
14
+
15
+ ## 0.48.1
16
+
17
+ ### Patch Changes
18
+
19
+ - 1625af2: The guide of `MongoDocumentStorage` states a write limit: 200 writes a second on one collection, with a p99 of 12 ms for 1 process and 39.5 ms for 4. The limit is provisional. At 400 writes a second the p99 is 414.8 ms, so that rate has no margin, and the rate stops near 412 writes a second.
20
+ - Updated dependencies [2d7edae]
21
+ - @procedures/client@0.48.1
22
+ - @procedures/collections@0.48.1
23
+
3
24
  ## 0.48.0
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -708,6 +708,17 @@ const notes = new MongoDocumentStorage<Note>({
708
708
  });
709
709
  ```
710
710
  - **The tests.** The storage passes the `CollectionStorage` contract on MongoDB 7 in CI. Set `MONGO_TEST_URL` to start them locally.
711
+ - **The stated write limit.** Plan for at most 200 writes a second on one collection, over all its processes. The limit is provisional: it comes from one 4-core CI runner and from a guess of the load of a tenant.
712
+
713
+ | Writes a second on one collection | Processes | p99 of a write | Reading |
714
+ |---|---|---|---|
715
+ | 200 | 1 | 12 ms | clean |
716
+ | 200 | 2 | 27.8 ms | clean |
717
+ | 200 | 4 | 39.5 ms | clean |
718
+ | 400 | 2 | 414.8 ms | no margin |
719
+ | 800 and 1,200 | 2 | over 1,000 ms | the rate stops near 412 |
720
+
721
+ The same runner writes 799 a second over 100 collections with a p99 of 37.5 ms, so the limit comes from the one collection. Runs: [the rungs](https://github.com/mark1russell7/client/actions/runs/41956238365), [the ceiling](https://github.com/mark1russell7/client/actions/runs/41966001438).
711
722
 
712
723
  ### Change hints from the change stream: `watchStorageChanges`
713
724