Working Set

A Working Set is a tree of persistent objects which supports replication.

Operational Transformation (OT) is used to allow for multi-master replication. Updates can be applied on any working set at any time, and they can always exchange operations and reach the same state.

The tree of objects is called the Universal Tree and the root of the tree is called the UT root.

A working set supports both mutable and immutable objects. The immutable objects are called ROD objects and support lazy replication.

A WorkingSet has a 128 bit UUID called a DataSetId which identifies the data in the working set. This is used as a sanity check to avoid data synchronisation between working sets that are supposed to manage unrelated data sets.

A WorkingSetMachine manages the transient state involved with supporting replication for a working set - i.e. the "sessions" with peers.

The associated PSpace and CSpace

A working set exists inside a single PSpace, which in turn exists inside a single CSpace. This means all the objects in the working set's universal tree are persistent objects of its associated PSpace and CSpace.

The function GetPSpace gets the associated PSpace of a given working set:


PSpace* GetPSpace(WorkingSetMachine* wsm);

Multiple working sets in a PSpace

There can be multiple working sets in a single PSpace. Within the PSpace they are uniquely identified by a name which is a UTF-8 string passed to the function OpenWorkingSetMachine which either creates a new working set or opens an existing working set.