3 ms·
This solution is suitable for processing documents. For example, figma uses a technique similar to CRDT. It is not suitable for processing orders.
by hamsterbase 3y ago
This solution is suitable for processing documents. For example, figma uses a technique similar to CRDT.
It is not suitable for processing orders.
- preseinger 3y agoif two different users modify the same version of the same document in different ways, how do you resolve that conflict without losing information?
- hamsterbase 3y agoI have recorded all the operations of a document. Each operation has an id . When the document is loaded into memory, it has a unique uuid as the agent id. If the current version is hash(a1 b2 c3) If two people edit the document at the same time the name will become hash(a1 b2 c3 e4) hash(a1 b2 c3 d4 d5) After merging, the document name will become hash(a1 b2 c3 d4 e4 d5) a1, b2 is "Lamport timestamp" https://en.wikipedia.org/wiki/Lamport_timestamp https://en.wikipedia.org/wiki/Lamport_timestamp the full version (a1 b2 c3 e4) is “vector clock” https://en.wikipedia.org/wiki/Vector_clock https://en.wikipedia.org/wiki/Vector_clock
- preseinger 3y agoif d4 and e4 are conflicting edits, then how do you resolve them? say (a1 b2 c3) is "abc" -- (a1 b2 c3 d4 d5) is "abxx" and (a1 b2 c3 e4) is "aby" what is (a1 b2 c3 d4 e4)? it isn't "abxxy" or "abxy" or "abxxy" or anything else, because d4 and e4 are concurrent/conflicting updates, which have no single well-defined resolution (without additional information) meaning, this is a conflict if you just say that this resolves to (a1 b2 c3 e4) then this is LWW but you've lost the information in d4 and d5, so whoever was agent d has written information that was good for a little while, but then ultimately lost after merge, right? so this isn't consistent in any useful way?