{"id":26346939,"url":"https://github.com/coast-team/dotted-logootsplit","last_synced_at":"2025-03-16T07:15:02.845Z","repository":{"id":51869708,"uuid":"125399506","full_name":"coast-team/dotted-logootsplit","owner":"coast-team","description":"A delta-state block-wise sequence CRDT","archived":false,"fork":false,"pushed_at":"2023-02-03T14:33:43.000Z","size":722,"stargazers_count":58,"open_issues_count":0,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-03T19:40:48.664Z","etag":null,"topics":["collaborative","crdt","data-structure","distributed","eventually-consistent","peer-to-peer","sequence"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coast-team.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-15T16:56:52.000Z","updated_at":"2025-02-16T01:56:59.000Z","dependencies_parsed_at":"2023-02-18T08:01:03.994Z","dependency_job_id":null,"html_url":"https://github.com/coast-team/dotted-logootsplit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-team%2Fdotted-logootsplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-team%2Fdotted-logootsplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-team%2Fdotted-logootsplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coast-team%2Fdotted-logootsplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coast-team","download_url":"https://codeload.github.com/coast-team/dotted-logootsplit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243836003,"owners_count":20355616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collaborative","crdt","data-structure","distributed","eventually-consistent","peer-to-peer","sequence"],"created_at":"2025-03-16T07:15:02.263Z","updated_at":"2025-03-16T07:15:02.830Z","avatar_url":"https://github.com/coast-team.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dotted LogootSplit: A delta block-wise sequence CRDT\n\n[![travis][travis-image]][travis-url]\n[![NPM version][npm-image]][npm-url]\n\nA [CRDT][crdt] is a data structure which can be replicated over multiple devices and thus concurrently edited.\nMost of the CRDT embeds metadata in order to avoid conflicting edits.\nThe challenge is to keep these metadata as small as possible.\n\nLogootSplit [[1]](#ref-1) is a sequence CRDT which reduces the metadata of preceding sequence CRDT; to do so it aggregates elements.\n\nLogootSplit is an operation-based CRDT. Hence, it is necessary to use a network layer to deliver exactly-once the operations.\nIt requires also to deliver removals after insertions. In practice, this is difficult to implement.\n\nDelta-based CRDT [[2]](#ref-2) have less assumptions. Most of delta-based CRDT simply assume a FIFO delivery (deltas from a same replica, are merged in-order).\nThey also enable to merge two states. This is particularly interesting for intensive collaborative sessions with long periods of disconnection.\n\nDotted LogootSplit offers a delta-based version of LogootSplit with smaller metadata.\nWe provide both op-based and delta-based synchronizations.\n\n## Publication\n\nComing soon...\n\n## References\n\n[1]\u003ca id=\"ref-1\"\u003e Luc André, Stéphane Martin, Gérald Oster, Claudia-Lavinia\nIgnat. **Supporting Adaptable Granularity of Changes for Massive-scale\nCollaborative Editing**. In _Proceedings of the international conference on\ncollaborative computing: networking, applications and worksharing -\nCollaborateCom 2013_. IEEE Computer Society, october 2013, pages 50–59.\n[hal-00903813](https://hal.inria.fr/hal-00903813/)\n\n[2]\u003ca id=\"ref-2\"\u003e Paulo Sérgio Almeida,, Ali Shoker,\nCarlos Baquero. **Delta State Replicated Data Types**, Journal of Parallel and\nDistributed Computing, Volume 111, January 2018, Pages 162-173.\n[arXiv:1603.01529](https://arxiv.org/pdf/1603.01529.pdf)\n\n## Usage\n\n```\nnpm install dotted-logootsplit\n```\n\nThe following example craetes two replicas and uses delta-based synchornozations.\n\n```ts\nimport { avl, SimpleDotBlockFactory } from \"dotted-logootsplit\"\n\nconst seed = \"dotted-logootsplit\" // for reproducibility\n\nconst replicaA = 0\nconst strategyA = SimpleBlockFactory.from(replicaA, seed)\nconst stateA = avl.deltaEditableList(strategyA, \"\")\n\nconst replicaB = 1\nconst strategyB = SimpleBlockFactory.from(replicaB, seed)\nconst stateB = avl.deltaEditableList(strategyB, \"\")\n\nconst deltaA1 = stateA.insertAt(0, \"Helo  \")\nconst deltaA2 = stateA.insertAt(6, \"world!\")\nconsole.log(stateA.concatenated(\"\"))\n// A: \"Helo  world!\"\n\n// delta sync\nstateB.applyDelta(deltaA1)\nconsole.log(stateB.concatenated(\"\"))\n// B: \"Helo  \"\n\nconst deltaB1 = stateB.insertAt(2, \"l\")\nconsole.log(stateB.concatenated(\"\"))\n// B: \"Hello  \"\n\nstateB.applyDelta(deltaA2)\nconsole.log(stateB.concatenated(\"\"))\n// B: \"Hello  world!\"\n\nconst deltasB2 = stateB.removeAt(5, 1) // remove a space\nconsole.log(stateB.concatenated(\"\"))\n// B: \"Hello world!\"\n\nstateA.applyDelta(deltaB1)\nfor (const d of deltasB2) {\n    stateA.applyDelta(d)\n}\nconsole.log(stateA.concatenated(\"\"))\n// A: \"Hello world!\"\n```\n\n## TODO\n\n-   [x] Local editing\n-   [x] Op-based sync\n-   [x] causal delta-based sync\n-   [ ] Out-of-order delta-based sync (WIP)\n-   [x] state-based sync (state merging)\n-   [ ] Anchors (a participant cursor is an anchor)\n-   [ ] LSeq-like positions and generation strategies\n-   [ ] Simpler balanced tree implementation\n\n[crdt]: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type\n[travis-image]: https://travis-ci.org/coast-team/dotted-logootsplit.svg\n[travis-url]: https://travis-ci.org/coast-team/dotted-logootsplit\n[npm-image]: https://img.shields.io/npm/v/dotted-logootsplit.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/dotted-logootsplit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoast-team%2Fdotted-logootsplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoast-team%2Fdotted-logootsplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoast-team%2Fdotted-logootsplit/lists"}