4 ms·
I am the author of the CT vector CRDT, also the author of the Replicated Object Notation http://github.com/gritzko/ron http://github.com/gritzko/ron. I tried t
by gritzko 8y ago
I am the author of the CT vector CRDT, also the author of the Replicated Object Notation http://github.com/gritzko/ron http://github.com/gritzko/ron.
I tried to look into the code, and I am not sure which way they implemented list and vector. The explanation is a bit confusing, especially the mention of "insertion index".
Definition and support for Schism's Convergent List type. The
convergent list is a simple timestamped log of entries with a vector
clock. Convergence places entries into the resultant list In
insertion order. The vector clock conveys that an item has been
removed from the list on another node."
Convergence places entries into the
resultant vector in insertion order, with insertions occurring by
replaying insertions operations in order.
CRDT is all about partial orders, so what does it all mean?
Orders are different for different replicas.
(Disclaimer. I am not a Clojurist.)
- dunham 8y agoYeah, I couldn't follow the descriptions either. It looks like "list" only supports appending (conj), removing the first item (rest), and removing all items (empty). The data consists of a list of items, a "clock" (map of nodeId to Date object), and a list of (nodeId,Date) corresponding to the values. I think they're using the clock to determine whether to drop deleted items on merge. Code for the operations is [list.cljc:153-169](https://github.com/aredington/schism/blob/master/src/schism/impl/types/list.cljc#L153-L169 https://github.com/aredington/schism/blob/master/src/schism/...). The merge code is "synchronize" a little further down (I didn't read through it). The "vector" object supports append (conj), pop, clearing the list (empty), and setting a value at a position (assoc). It does _not_ support insert/delete. It is structured similarly to "list" except using vectors instead of lists for the values and the timestamps. Code is at [vector.cljc:222-244](https://github.com/aredington/schism/blob/master/src/schism/impl/types/vector.cljc#L222-L244 https://github.com/aredington/schism/blob/master/src/schism/...)