Get the latest tech news
Movable tree CRDTs and Loro's implementation
This article introduces the implementation difficulties and challenges of Movable Tree CRDTs when collaboration, and how Loro implements it and sorts child nodes. The algorithm has high performance and can be used in production.
Challenges arise in resolving conflicts and meeting user expectations when working with the data structure that models movement by combining deletion and insertion. On the other hand, the core undo-do-redo process of the algorithm is highly similar to how REG (Replayable Event Graph) applies remote updates in Loro. However, the Fractional Index has the problem of interleaving (opens in a new tab), but this is acceptable when some only need relative order and do not require strict sequential semantics, such as figma layer items, multi-level bookmarks, etc.
Or read this on Hacker News