yorkie-team / yorkie

Yorkie is a document store for collaborative applications.
https://yorkie.dev
Apache License 2.0
771 stars 143 forks source link

Suggest conducting research on Loro and the operating principles of Loro's DiffCalculator. #966

Open JOOHOJANG opened 3 weeks ago

JOOHOJANG commented 3 weeks ago

Description: Suggest conducting research on Loro and the operating principles of Loro's DiffCalculator.

Why: Loro is currently one of the leading CRDT libraries.

It is implemented using the REG idea. For more details, refer to the link below. https://loro.dev/docs/advanced/replayable_event_graph https://loro.dev/docs/advanced/version_deep_dive https://loro.dev/blog/loro-richtext https://codepair.yorkie.dev/jooho/6693b8536137c62378879e57/share?token=4h1ma (summarization of loro (in korean))

The benefits of applying REG include:

  1. Removing tombstones to free up memory
  2. Eliminating coordinate systems like CRDTXXXPos in Yorkie
  3. Fast time travel

Anyway, the point I want to make is:

Loro uses an Oplog to record changes and versions, and updates are done by calculating the difference between two versions and applying it to the state. DiffCalculator is responsible for calculating the difference between two versions. The logic is complex and difficult to understand, but if we can analyze it properly, it might help us determine whether we can apply the REG idea to Yorkie.