Scalability of y-websocket server

The example ws-server available in y-websocket is a bit far off from something that can be made horizontally scalable. For example an update that is received on a socket connection somewhere over here https://github.com/yjs/y-websocket/blob/master/bin/utils.js#L169 will be the one that will be persisted to the database, because ydoc can be updated by redis pub-sub too.

I had to dig in the code y-protocols/sync and copy relevant parts till I had the update which would be applied to the y-doc, and then persisted that update to the db. This seems to be working fine.

Now comes the part of making the socket server horizontally scalable by applying patches from y-redis into my makeshift socket server connection