Replicated data types
An RDT is a formal construct that describes anything that can work over a partially ordered op log. It can be a CRDT (either subtype), like Counter or anything else. One popular example is RPC (remote procedure call) which employs scoped operations to avoid global op propagation. Another peculiar example is a Swarm-based crypto currency.
General principles for every kind of RDT:
- RDT objects have a state which is mutated by applying ops
- the same set of ops produces the same state ("same" means bitwise identical)
- reordering of concurrent ops does not affect the resulting state
- external APIs of an RDT should be idiomatic to their language of implementation, hence they may vary from language to language
A good RDT must have:
- a clear mission and a discussion of tradeoffs,
- proof of correctness,
- test cases consisting of op sequences and resulting states (preferably concurrent cases too)
- ideally, JavaScript, C++ and Java implementations.
Each RDT type has an unique transcendent id.
That is a single Base64x64 number, which is typically human-readable.
For example, Counter
.
Hence, every spec of every op of a Counter object starts with /Counter
.
The other half of the type id is either empty (default) or abnormal.
Abnormal halves are used to convey type parameters, e.g. /Counter+~x
.