JsonOt
OTjson_ot One shared JSON document that many people can edit at once and always agree on.
Open the live JsonOt demo →watershed’s json_ot kernel is a faithful port of the ottypes json0 algebra (the operational-transform model behind ShareDB). Instead of merging keys by rule, it edits one shared JSON document with a small algebra of operations addressed by a path into the tree: set a key, insert or delete a list item, splice a string.
It runs the single-op-in-flight client protocol: a client applies an edit optimistically and sends it, keeping at most one op in flight. A central server sequences every op, and concurrent ops are transformed past one another (a concurrent list insert has its index shifted), so all replicas reach identical state, indices and all. This is the other convergence family: transform rather than merge.
Best for
- Collaboratively edited structured documents (JSON trees, outlines, form models changed by many clients at once)
- Cases where last-write-wins would clobber a concurrent edit but you want one shared document rather than per-key CRDTs
- Studying the json0 algebra used by ottypes and ShareDB
- Merge rule
- one shared JSON document; simultaneous edits are adjusted to fit around each other
- Optimistic behavior
- you edit instantly; your in-flight change is adjusted as other people’s confirmed edits arrive
- Summary shape
- the document reloads to the same value everywhere, list positions and all
- Model
- Operational transform: converges by transforming concurrent operations