-
Notifications
You must be signed in to change notification settings - Fork 11
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
Reactive P2P architecture with hypercore #37
Comments
Good work Mr. @santakadev ! At least seems something worth it to try 🙂 I've some concerns about possible concurrency issues. I mean, if the peers doesn't share the very same source of truth, what would happen when there're race conditions situations like the following one:
I don't know if my assumptions are correct, so please question them because I could be missing a lot of considerations, and correct me where I'm wrong 👼 |
Good point @JavierCane I had made a little research about this concurrency problem when we start this project. There are some interesting papers that try to solve this problem. Here are some examples:
The problem is complex, and I think that for now we can avoid these race conditions that leads to inconsistent data, don't allowing collaborative editing (only session owner can write to the file) We can create new issues for solving these problems:
|
Ok. I agree with going ahead for this approach for now in order to unlock the Milestone 1.1 features, and we'll revisit it once we plan to add multiple users editing functionalities. 🤟 |
fixed in #40 |
Current architecture:
All write operations are performed by the peer initiating the session:
We have some features that need all peers to be able to perform write operation like:
Proposed architecture/solution:
Allow write operation to all peers:
In summary, each peer has a write hypercore DB and a read hypercore DB for each connected peer.
In this architecture, when a peer performs an action that wants to publish (for example: CHANGE_DISPLAY_NAME action), he/she simply store the action in its own DB. This action will be recieved by all peers by replication, and they will react to this action.
After a lot of try, error and documentation, I have a working prototype of this architecture that uses WebRTC datachannel, that we can translate to P2P Editor.
This architecture can be plugged easily with Redux and any frontend framework like React and Vue.
Other options that I have try without success:
The text was updated successfully, but these errors were encountered: