yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
499 stars 258 forks source link

[Question] subDocument vs WebSocket connection ? #66

Closed lijie1129 closed 3 years ago

lijie1129 commented 3 years ago

hi, I'm newer.

About subDocuments sync each other based on y-websocket.

I had read the Document(https://docs.yjs.dev/api/subdocuments), and found some confuses.

The one of them is:

Does there must create a separated WebSocket connection after invoke load() ?

Can I use only single WebSocket connection to Sync all YDocs?

Is there any detail information about it?

Huly®: YJS-502

dmonad commented 3 years ago

When using y-websocket, you have to create a single WebSocket connection for each document. There are efforts to synchronize several subdocuments over a single y-websocket connection.

This is the algorithm that I want to implement eventually: https://discuss.yjs.dev/t/question-regarding-updates-and-state-vectors-in-y-leveldb/399/6?u=dmonad

Please use https://discuss.yjs.dev/ for questions in the future.

Cheers, Kevin

lijie1129 commented 3 years ago

Thanks, Kevin. 🤝