Chet Corcos
02/19/2020, 8:15 AMA full-stack prototype of a collaborative web application backed by a Datalog-inspired database.Let me know what you guys think 🙂
Alex Miller
02/19/2020, 2:01 PMPeter Abrahamsen
02/19/2020, 5:18 PMChet Corcos
02/19/2020, 6:38 PMPeter Abrahamsen
02/19/2020, 6:55 PMChet Corcos
02/19/2020, 9:49 PMChet Corcos
02/19/2020, 9:49 PMPeter Abrahamsen
02/20/2020, 4:00 AMPeter Abrahamsen
02/20/2020, 4:00 AMPeter Abrahamsen
02/20/2020, 4:06 AMPeter Abrahamsen
02/20/2020, 4:07 AMPeter Abrahamsen
02/20/2020, 4:08 AMChet Corcos
02/20/2020, 7:05 PMogadaki
02/21/2020, 6:53 PMogadaki
02/21/2020, 6:57 PMChet Corcos
03/07/2020, 1:03 AMogadaki
03/07/2020, 6:01 PMI have this feeling that I can design it in a way that doesn't need a vector clock for causal consistencyA way to have causal consistency in an append only log, is to use a combination of a Lamport timestamp and an unique session ID, i.e. an ID unique to each site of editing. You order events based on the timestamp and when two events from two sites have the same timestamp you use the ID to choose the order in a deterministic way. It is actually what I have successfully used for my implementation of CausalTree/CRDT. You can find more information about this here: http://archagon.net/blog/2018/03/24/data-laced-with-history/. It is a very well written article and actually it is after reading it that I work on my Rust implementation of this. Here is en excerpt, explaining the ordering of the event log:
"This won’t be convergent by default since the operations don’t have an inherent total order, but it’s easy to fix this by giving each one a globally-unique ID in the form of an owner UUID
plus a Lamport timestamp. (In the diagrams below, this is encoded as “SX@TY”, where “SX” represents the UUID for site X, and Y is just the timestamp.) With this scheme, no two operations can have the same ID: operations from the same owner will have different timestamps, while operations from different owners will have different UUIDs. The Lamport timestamps will be used to sort the operations into causal order, leaving the UUIDs for tiebreaking when concurrent operations happen to have the same timestamp."
ogadaki
03/07/2020, 6:14 PMPeter Abrahamsen
03/07/2020, 7:12 PMChet Corcos
03/07/2020, 7:16 PMChet Corcos
03/07/2020, 7:18 PMPeter Abrahamsen
03/07/2020, 7:28 PMPeter Abrahamsen
03/07/2020, 7:37 PMPeter Abrahamsen
03/07/2020, 7:39 PMogadaki
03/08/2020, 8:04 AMogadaki
03/08/2020, 8:29 AMThe problem with causal consistency is that the clock gets really large with an arbitrary number of collaborators... I’m hoping that I can come up with some way of indexing the transaction log so I can query for the last transaction involving some fact and enforce causality that way.Yes, that concerns make me also not completely satisfied with this kind of implementation of event log. Let me know about your progress on this! 🙂
ogadaki
03/08/2020, 8:34 AMNot all forms of inconsistency can be identified at the database or application layers, or indeed encoded at all.I totally agree! The consistency addressed with the TimeStamp+SiteId is only to be sure the event log order is strictly the same on two sites, but it is a work at an upper abstraction to deal with the "user-faced" consistency, and maybe occasionally asking a user to manage manually the conflicts (Ă la merge conflict in git for example).
ogadaki
03/08/2020, 9:02 AMPeter Abrahamsen
03/08/2020, 8:59 PMPeter Abrahamsen
03/08/2020, 9:12 PM