reddb-cli 0.1.2-next.91 → 0.1.2-next.98

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.
Files changed (2) hide show
  1. package/README.md +25 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -323,6 +323,31 @@ Every page has a CRC32 checksum (verified on read). Every WAL record has a CRC32
323
323
 
324
324
  ---
325
325
 
326
+ ## Eventual Consistency
327
+
328
+ RedDB supports per-field eventual consistency via an append-only transaction log with periodic consolidation. Inspired by CRDT principles (commutative, associative reducers), it enables high-throughput write patterns while guaranteeing convergence.
329
+
330
+ ```bash
331
+ # Track clicks with async consolidation (returns instantly)
332
+ curl -X POST localhost:8080/ec/urls/clicks/add -d '{"id": 1, "value": 1}'
333
+
334
+ # Check consolidated + pending value
335
+ curl localhost:8080/ec/urls/clicks/status?id=1
336
+ ```
337
+
338
+ | Feature | Description |
339
+ |:--------|:------------|
340
+ | **6 reducers** | Sum, Max, Min, Count, Average, Last (last-write-wins) |
341
+ | **Sync mode** | Consolidates immediately (strong consistency) |
342
+ | **Async mode** | Background worker consolidates periodically (high throughput) |
343
+ | **Transaction log** | Immutable append-only audit trail per field |
344
+ | **SET checkpoint** | Resets base value, discards prior operations |
345
+ | **All modes** | Works in server, embedded (Rust API), and serverless |
346
+
347
+ See the [Eventual Consistency Guide](https://forattini-dev.github.io/reddb/#/guides/eventual-consistency) for the theory (CAP theorem, CRDTs, convergence) and full API reference.
348
+
349
+ ---
350
+
326
351
  ## Quick Start
327
352
 
328
353
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reddb-cli",
3
- "version": "0.1.2-next.91",
3
+ "version": "0.1.2-next.98",
4
4
  "description": "JavaScript/TypeScript SDK for RedDB - unified multi-model database",
5
5
  "type": "commonjs",
6
6
  "main": "./sdk/red-sdk.js",