3 ms·
Great article! I wonder how hierarchical node updates are done, how multi user on that deep map is handled specifically. I just recently put into production a
by coolhand2120 2y ago
Great article! I wonder how hierarchical node updates are done, how multi user on that deep map is handled specifically.
I just recently put into production a large scale document centric CRDT editor using yjs and Vue3/Vuetify. This is a platform agnostic WYSIWYG editor that supports around 30M daily users. It was a really intense experience writing this software! It uses YJS as the document, then creates an event sourced change stream (ydoc changes) that is streamed in via a websocket (APIGWV2) lambda into a dynamodb, then projected into S3 as plain old JSON for service load. The editor presents "what the web sees" for platform preview and is interpreted from the ydoc. All serverless. Multi user is awesome! History is awesome! The whole thing is just really cool!
I ran into two major issues: upstream updates being too large for a websocket which I fixed with signed URLs to a S3 YJS triggered lambda that inserted these very large events - which are exceptionally rare, like when I user copies/pastes a giant doc. That and multi user hierarchical updates, like where a user updates a parent node and that triggers an update of the children messing up the other user. The trick was to flatten the hierarchy into a linked list on save and save the doc as a flat ymap structure in the DB. I had to chunk serialized strings into dynamodb because of the ~400k row limit, but no regrets, loads are very fast over WS even when chunked. Lots of learning. Really fun system to write.