-
Notifications
You must be signed in to change notification settings - Fork 0
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
Change synchronisation model to event-sourcing #76
Comments
Thanks for your idea of using event-sourcing. Generally, I like the concept and I think we already discussed this during the design phase of the backend. But we saw a few drawbacks in our case, since synchronization-issues are still possible: Synchronization-issues could occur, when two clients are committing (sending) a change-event (before receiving the other event). Our solution for the backend is, by just repeating/propagating all received states to all clients in the same order as received by the server. The client that 'creates' the changed state has to ignore its own message when receiving it. So, I don't see an immediate advantage over the current implementation and switching to eventsourcing means huge changes in the backend as well as in the frontend. I think before doing this, we should resolve the other known issues first. |
The problem you describe with out-of-order transmissions is exactly one of the problems event-sourcing would solve though. The whole point is to not transmit the complete updated state in one event but rather small incremental changes. So if one client changes the playback speed and another clicks pause, those two different events can simply both be applied (no matter the order). I agree though that it is a lot of work and might bring with it new problems. I'll see if I can implement a proof-of-concept to test whether it actually works better. |
In case of the backend, I think, we can implement and test this step by step by supporting both variants for some time... |
I think event sourcing is cool, but it is not that relevant for our use case. All clients end up in the same state at the end, because of the server-side time signatures. We do not need the whole history at this point. Ignoring states that are older than the current state in the frontend is enough for our use case. There are far more open issues in the front end that have a bigger impact on the user experience (e.g. the communication issues with video.js). These issues create real problems and I don't think we would have a benefit while solving this issue here. Especially in contrast to the afford required to restructure the whole backend. Nevertheless, I am fine with it if somebody wants to add the event sourcing and all features are implemented/tested to the current level. |
Event-Sourcing is an architecture to synchronize distributed systems based on past actions.
The Vuex store is already internally event-sourced since the state is built by folding over all commits. If we could utilize the commit-log and simply send every commit over the wire to other clients the store state would automatically be synchronized.
To implement this I propose a protocol which will still be transported over socket.io.
It would essentially need three actions:
If possible this should be implemented as a Vuex store module so that not the complete store is synchronized but only a portion of it.
In this new module the backend would not need to save old room state but instead only serve as a bridge between peers in a room.
The text was updated successfully, but these errors were encountered: