https://github.com/bcherny/crdt-demo
https://github.com/bcherny/crdt-demo
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bcherny/crdt-demo
- Owner: bcherny
- Created: 2020-05-23T01:46:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T20:32:41.000Z (almost 3 years ago)
- Last Synced: 2025-02-12T23:38:02.589Z (8 months ago)
- Language: TypeScript
- Size: 4.32 MB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WOOT-style CRDT implementation
> See https://arxiv.org/pdf/1810.02137.pdf
eg. for document "abe":
1. Load document
2. Initialize Internal State:```ts
let internalState = [
{type: 'START_MARKER'}, // @s
{
type: 'CHAR',
idb: 'h7236ge', // identifier for this object
ida: null, // identifier for object to the left
ide: '72gd73g', // identifier for object to the right
value: 'a',
v: true, // bool indicating this object is visible (as opposed to "iv" -- invisible)
},
{
type: 'CHAR',
idb: '72gd73g', // identifier for this object
ida: 'h7236ge', // identifier for object to the left
ide: '72gd73g', // identifier for object to the right
value: 'b',
v: true, // bool indicating this object is visible (as opposed to "iv" -- invisible)
},
{
type: 'CHAR',
idb: 'u3h3uh3', // identifier for this object
ida: '72gd73g', // identifier for object to the left
ide: null, // identifier for object to the right
value: 'e',
v: true, // bool indicating this object is visible (as opposed to "iv" -- invisible)
},
{type: 'END_MARKER'}, // @e
]
```# Notes
## Context-Based Operational Transformation in Distributed Collaborative Editing Systems (Sun & Sun, 2009)
- **Causal-dependency relation (`A -> B`)**. When `A` happened before `B` non-concurrently.
- **Causal-independency relation (`A || B`)**. When `A` and `B` happened concurrently.