Crate ron_crdt

source ·
Expand description

This is documentation for the ron crate.

RON is the Replicated Object Notation, a distributed live data format by Victor Grishchenko.

RON is the language in which object states and mutations, as well as all other parts of the Swarm protocol, are expressed in Swarm. RON consists (solely!) of a series of UUIDs (128-bit numbers), but the order of UUIDs matter, and there are many different kinds of UUIDs, depending on the context.

UUIDs provide sufficient metadata to object and their mutations to allow the implementation of CRDTs in a network of peers.

RON features two different wire formats: text and binary. Both offer several ways of compression, adding to the complexity. We will handle compression later, but note here that efficient compression is what makes RON and Swarm practical. Compression reduces the metadata overhead.

One particular combination of four UUIDs makes up an operation (short: ops) with one UUID each for the type, object, event and value. Several operations make up the state or mutation of an object, we call this a frame.

Special kinds of RON ops are used for protocol handshakes and frame headers (metadata for frames). These operations have special meaning, and often omit some of the metadata that is usually included in an operation (for example, a handshake query does not have a timestamp).

Re-exports

pub use atom::Atom;
pub use batch::Batch;
pub use crdt::CRDT;
pub use frame::Frame;
pub use heap::FrameOrd;
pub use heap::Heap;
pub use op::Op;
pub use op::Terminator;
pub use uuid::UUID;

Modules

Op palyoads
Batch
Conflict-freee replicated datatypes.
Frame
Frame Heap
Op
UUID

Structs

An LWW is an associated map from UUIDs to Atoms. Conflicting writes are merge by using the Op event timestamp. The last writes wins.
2-Phase sets are sets of atoms. Each element is associated with the timestamp of the Op that inserted it. Removing elements is done my inserting a tombstone. Thus, deletions override insertions.