You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think you can save a lot of DynamoDB data loading and lambda cycles per ws message by avoiding calling getOrCreateDoc unless you really need it.
For example with messageAwareness messages, you can just broadcast and return early because they don't mutate the doc.
Even with messageSync messages, you may only really need to load the doc for writeSyncStep1.
That is to say, you might be able to skip loading the doc even for updates, because you are just doing a push and a broadcast
I see that you are calling Y.applyUpdate but it doesn't seem like that is necessary when just pushing an update to dynamo and rebroadcasting the original message
I think with those changes you would only ever have to actually read from DynamoDB and load the document and apply all known updates when clients send writeSyncStep1 after connecting
From dmonad:
Loading Yjs documents is the most expensive operation in y-websocket server. So my approach is to avoid loading the document by computing the differences directly on the binary update messages using the API I proposed here: yjs/yjs#263
It would be great if you could publish your work on https://discuss.yjs.dev/ if you want to make it available (using the "show" tag).
The text was updated successfully, but these errors were encountered:
@gaberogan - Thanks so much for putting this together! The demo works. Have you done any tweaks to this library? I'm going to take a look at it later today. I'l likely rewrite in Typescript. I'm thinking of combining it with the serverless framework, looking into the mergeUpdate method, and look at the optimizations that are suggested.
For flushing the document history, we might be able to use DynamoDB and setting a TTL or time-to-live property, and expire them after a certain time.
From WinstonFassett:
I think you can save a lot of DynamoDB data loading and lambda cycles per ws message by avoiding calling getOrCreateDoc unless you really need it.
For example with messageAwareness messages, you can just broadcast and return early because they don't mutate the doc.
Even with messageSync messages, you may only really need to load the doc for writeSyncStep1.
That is to say, you might be able to skip loading the doc even for updates, because you are just doing a push and a broadcast
I see that you are calling Y.applyUpdate but it doesn't seem like that is necessary when just pushing an update to dynamo and rebroadcasting the original message
I think with those changes you would only ever have to actually read from DynamoDB and load the document and apply all known updates when clients send writeSyncStep1 after connecting
From dmonad:
Loading Yjs documents is the most expensive operation in y-websocket server. So my approach is to avoid loading the document by computing the differences directly on the binary update messages using the API I proposed here: yjs/yjs#263
It would be great if you could publish your work on https://discuss.yjs.dev/ if you want to make it available (using the "show" tag).
The text was updated successfully, but these errors were encountered: