globally consistent event ordering for decentralized distributed systems
Example: A shared red ball that bounces of walls and its direction can be inverted by every client*
npm i co-consistent
Synchronizing action ordering across multiple clients in a network can be done in various ways. co-consistent uses a shared timeline to order events and a clock that can jump forward in time.
Other concepts rely on a heavy server to order actions and compute state.
co-consistent offloads this work to the clients and is designed for a peer-to-peer scenario but can also be used in a client-server architecture.
The code for each example can be found on the respective pages
- State - simple example with multiplication and addition
- Parallel - edit states in parallel without touching the other
- Continous - extrapolate state for representing the continous position of a ball
The Continous example implemented with co-share and simulated in the browser with latency and jitter.