Yjs Deep Dive#
These are my notes while prototyping and researching Yjs for our shopping list app.
yjs/yjs#
dmonad on the Yjs Community Kevin Jahns (creator of yjs)#
Introduction to SyncedStore | SyncedStore - Javascript CRDT based real-time sync
you should think very carefully about the schema of your data. Because it’s really hard to change it once you have active users
Syncing document to Postgres database - Yjs Community
Y.encodeStateAsUpdate(doc) returns a Uint8Array of the entire Doc.
Subsequent updates can be saved individually when the doc changes:
Easy to understand explanation of how Yjs works - Yjs Community
In CRDTs we usually don’t think in terms of events. For me, it would be more natural to think about state. Yjs maintains a linked list. Eventually, all clients will end up with the same linked list. CRDTs give you an algorithm to “put that state together” so that everyone ends up with the same state.
This is very different to Operation Transformation, where we think in terms of operations that need to be transformed so that everyone ends up with the same content.
Why are yjs types writen with jsdocs and not typescript? - Yjs Community
Server#
https://channels-yroom.readthedocs.io/en/latest/
django channels
MIT
yjs/y-redis: Alternative backend for y-websocket
AGPL
pg_crdt - an experimental CRDT extension for Postgres
proof of concept by supabase
Random Stuff#
y-octo: Why we’re not using yrs
multi-threading, Memory efficiency, libraries, „yrs panics everywhere, rather than returning the Result type“
Triplit | The Fullstack Database
typescript, relational
-
„a Yjs server with persistence and auth“
Rust and Typescript
yjs/yjs#
Flutter#
Journey from yjs in python to octobase_flutter:
Looks promising, but incomplete and partly abandoned like everything else in this space: toeverything/OctoBase
If AFFiNE really uses OctoBase and is any good, then maybe that’s no problem. 🤷