An interesting part of Yjs that I only discovered recently is that subdocuments, that is instances of Y.Doc nested within other Y.Doc objects, can be created and lazily loaded. Does your server implementation handle this case? (if there is even any special handling to do) In another post on this forum: Extend y-websocket provider to support sub docs synchronization in one websocket connection - #4 by douira support for subdocuments in y-websocket was implemented. If I want to allow the same website to show multiple documents without needing to open a new websocket connection for each one, this is important. I’m not sure how this would be persisted in the database though and how it would work with your server layer. They do modify the server provided by y-websocket, so some changes would probably be necessary to make subdocuments work.
Importantly, each document needs its own separated awareness instance, even if the user isn’t editing multiple documents at the same time. Things like collaborative cursors use the awareness instance to synchronize and sharing this across all (potentially many) documents would be highly inefficient. Things like showing the participants of a particular or multiple documents also wouldn’t work if the awareness instance was globally shared.