Open ViktorQvarfordt opened 2 years ago
Shouldn’t that happen on the backend side though?
That could work. However, in that case every keystroke from every user still reaches the server, causing unnecessary load.
You’re right. After thinking about this, I like the idea and I think it should be added to the provider. 👍
The problem I am facing When many users are collaborating on a YDoc simultaneously, Yjs updates are sent and received very frequently. This causes strain on the clients and the server.
The solution I would like An optional setting on HocuspocusProvider to throttle both sending and receiving Yjs updates. Essentially simulating a throttled network. The provider can internally use Y.mergeUpdates to batch the throttled updates.
Alternatives I have considered We have considered moving the throttling to the application level rather than the provider, but this doesn't work since conflict resolution would need to be handled. We should of course delegate conflict resolution to Yjs which we get by moving the throttling to the level of Yjs updates.