Skip to content

Change synchronisation model to event-sourcing #76

@lilioid

Description

@lilioid

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:

  • commit: whenever one of the peers in the system commits something into the store, this commit should be transferred over the wire as well.
  • request_log: when a new peer joins the group, that peer needs to request old commits.
  • log: this type of message should include the complete commit-log so that a new peer can build its state.
    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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions