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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of implementation

implementation

Photo of Loro

Loro

Photo of CRDTs

CRDTs

Related news:

News photo

Show HN: I wrote a partial re-implementation of DirectMusic

News photo

Multics Emacs: the history, design, and implementation (1979)

News photo

Implementation of Google's Griffin Architecture – RNN LLM