Shared data types for building collaborative software
It's interesting to me that people still doubt that CRDTs can be used in practice. The fact is that they are already being used in practice by many companies with millions of users for applications like rich-text editing to state management in 3d applications. See https://github.com/yjs/yjs#who-is-using-yjs
In fact, Yjs - a CRDT implementation- is the most downloaded solution for collaborative applications. Even more than ShareDB (the most popular OT-based solution).
Yjs ~90k/week - https://www.npmjs.com/package/yjs
ShareDB ~13k/week - https://www.npmjs.com/package/yjs
The world's fastest CRDT. WIP.
Yep. I've done something very similar on top of Diamond Types for a little personal wiki. This page is synced between all users who have the page open. Its a remarkably small piece of code, outside of the CRDT library itself (which is in rust via wasm). The way it works is:
- On page load, the server sends the whole CRDT document to the browser, and the server streams changes from that point onwards.
- When a change happens in the browser, it makes that change locally then and sends anything the server doesn't know about upstream.
- Whenever the server finds out about a new change, it re-broadcasts that change to any subscribed browser streams.
I'm using the braid HTTP protocol for changes - but we could easily switch to a SSE or websocket solution. It doesn't really matter.
At the moment I'm just using flat files for storage, but there's nothing stopping you using a database instead, except that its a bit awkward to use efficient CRDT packing techniques in a database.
Code is here, if anyone is interested. The whole thing is a few hundred lines all up: https://github.com/josephg/diamond-types/tree/0cb5d7ecf49364...
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
1 project | news.ycombinator.com | 21 May 2022
Yjs - Shared data types for building collaborative software
1 project | reddit.com/r/github_trends | 17 May 2022
1 project | reddit.com/r/CRDTs | 23 Apr 2022
What do apps like Figma use for collaboration? TogetherJS, Convergence?
1 project | reddit.com/r/webdev | 19 Apr 2022
Making CRDTs Byzantine Fault Tolerant [pdf]
3 projects | news.ycombinator.com | 4 Mar 2022