DistributedData
Defined in: src/crdt/DistributedData.ts:251
Cluster-wide replicated key-value store of CRDTs. Each node hosts
one local replica. update(key, ...) mutates the local replica
(idempotent, conflict-free), and gossip fans the state out so
every replica eventually agrees on merge(...) of all updates.
Lifecycle: call extension(DistributedDataId).start(cluster)
once per process to spawn the internal gossip actor. Subsequent
calls return the same handle.
const dd = system.extension(DistributedDataId).start(cluster);
dd.update(‘cart-42’, () => ORSet.empty
Limits / non-goals (v1):
- Full-state push on every gossip tick — fine for small stores.
- No durable persistence: the store lives in memory.
- No tombstone delete;
delete(key)is best-effort and can be undone by an in-flight gossip from a peer who still has the key. Plan a workload-specific tombstone pattern (typically embed deletion in the CRDT — e.g.ORSet.remove).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DistributedData(
system):DistributedData
Defined in: src/crdt/DistributedData.ts:255
Parameters
Section titled “Parameters”system
Section titled “system”Returns
Section titled “Returns”DistributedData
Methods
Section titled “Methods”get():
DistributedDataHandle
Defined in: src/crdt/DistributedData.ts:316
Returns
Section titled “Returns”DistributedDataHandle
isStarted()
Section titled “isStarted()”isStarted():
boolean
Defined in: src/crdt/DistributedData.ts:323
Returns
Section titled “Returns”boolean
start()
Section titled “start()”start(
cluster,options?):DistributedDataHandle
Defined in: src/crdt/DistributedData.ts:257
Parameters
Section titled “Parameters”cluster
Section titled “cluster”options?
Section titled “options?”Returns
Section titled “Returns”DistributedDataHandle
stop()
Section titled “stop()”stop():
void
Defined in: src/crdt/DistributedData.ts:310
Tear down the wire-handler subscriptions (test/shutdown only).
Returns
Section titled “Returns”void
