Operation-based variant of CRDTs is based on idea, that instead of replicating the state (or its delta), we replicate the operations, and let the corresponding replica build eventually consistent state from operations only. A standardized API for such data types consist of several members:
initial
: empty instance of CRDT object.query
: returns a value out of the CRDT object.atSource
: which returns a serializable operation. I.e. for a givenCounter
CRDT, itsatSource
function could return operations likeinc(replicaId, delta)
ordec(replicaId, delta)
.downstream
which is used to consume operations incoming from both local and remote sources to produce new state of the CRDT object.