toeverything / OctoBase

🐙 OctoBase is the open-source database behind AFFiNE, local-first, yet collaborative. A light-weight, scalable, data engine written in Rust.
https://octobase.dev
GNU Affero General Public License v3.0
1.31k stars 83 forks source link

Port CRDT operations #403

Open Brooooooklyn opened 1 year ago

Brooooooklyn commented 1 year ago
### Tasks
- [ ] https://github.com/toeverything/OctoBase/pull/408
- [ ] https://github.com/toeverything/OctoBase/issues/404
- [ ] https://github.com/toeverything/OctoBase/issues/411
- [ ] #413
- [ ] #430
- [ ] https://github.com/toeverything/OctoBase/pull/421
- [ ] https://github.com/toeverything/OctoBase/pull/422
- [ ] #440
- [ ] https://github.com/toeverything/OctoBase/issues/405
- [ ] #438
- [ ] #449
- [ ] https://github.com/toeverything/OctoBase/issues/409
darkskygit commented 1 year ago

crdt ops in yjs can be divided into two categories: map and list.

Both map and set use item.left and item.right to form a series of items into a linked list.

The difference is that the map does not care about the key order and contains parentSub(key), while the list does not.

YText and YXmlText are implemented slightly different from list to increase support for Format, but the final operation logic is similar.