DistributedData
Defined in: src/crdt/DistributedData.ts:252
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:256
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:303
Returns
Section titled “Returns”DistributedDataHandle
isStarted()
Section titled “isStarted()”isStarted():
boolean
Defined in: src/crdt/DistributedData.ts:310
Returns
Section titled “Returns”boolean
start()
Section titled “start()”start(
cluster,settings?):DistributedDataHandle
Defined in: src/crdt/DistributedData.ts:258
Parameters
Section titled “Parameters”cluster
Section titled “cluster”settings?
Section titled “settings?”Returns
Section titled “Returns”DistributedDataHandle
stop()
Section titled “stop()”stop():
void
Defined in: src/crdt/DistributedData.ts:297
Tear down the wire-handler subscriptions (test/shutdown only).
Returns
Section titled “Returns”void