Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic architecture and thoughts #36

Closed
SebastianStehle opened this issue Oct 1, 2023 · 4 comments
Closed

Basic architecture and thoughts #36

SebastianStehle opened this issue Oct 1, 2023 · 4 comments
Assignees

Comments

@SebastianStehle
Copy link
Collaborator

Basic Plan

I have started to play around with the code base a little bit. My idea would be the following:

  1. Create a server project that provides a network agnostic business layer and handles the following:
  • Loading documents
  • Saving documents (configurable)
  • Invoking hooks when something has changed (I need that).
  • Provide some methods to update stuff from server side (I also need that).
  1. Create network layers on top of the that like SignalR or WebSocket.

Questions

What I don't understand is:

Initial sync process

I am talking about the following code: https://github.com/yjs/ycs/blob/main/samples/YcsSample/Yjs/YcsManager.cs#L109. Perhaps I have some issues in understanding the general yjs protocol.

For my understanding, the client calls GetMissing and actually sends his document to the server, which then makes a diff and then gets a diff from the client and the server document.

After that the client would receive updates. But afaik this only works because the global lock. Otherwise The client could loose update messages. So would it not make more sense to send all update messages to the client and let him sort out that problem?

Scaling

I had a look to the following code: https://github.com/ueberdosis/hocuspocus/blob/main/packages/extension-redis/src/Redis.ts

So if I understand it properly, there are 2 concepts:

  1. The document potentially exists on all servers.
  2. The server documents and the awareness information are shared with pubsub.

Then signalr would not really make sense I think.

@SebastianStehle
Copy link
Collaborator Author

EDIT: I have created the basic setup. Nothing has been tested yet, but the basic code is there.

https://github.com/SebastianStehle/ydotnet

Please provide feedback.

@SebastianStehle
Copy link
Collaborator Author

UPDATE:

I got it working :)

@LSViana
Copy link
Collaborator

LSViana commented Oct 2, 2023

@SebastianStehle I will try to check your implementation in-depth tomorrow.

I see you got it working and that's very good news!

@LSViana LSViana self-assigned this Oct 4, 2023
@LSViana
Copy link
Collaborator

LSViana commented Oct 31, 2023

Resolved by #55.

@LSViana LSViana closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants