This is a simulation of Neil Fraser's "Differential Synchronization" algorithm using the "Guaranteed Delivery Method". To see it in action type text into any of the three client text textareas.
A simple protocol has been layered on top of Neil Fraser's algorithm to allow it to be used with bi-directional transports like WebSockets or abstractions like socket.io. When clients want to update the server they send a "saveEdits" command to the server with the array of edits to save. The server responds asynchronously with a "savedEdits" command that contains the client versions saved along with any other new edits avaialble from other clients. The server also sends an "editsAvailable" message to all the other clients who them in turn send "getEdits" commands. The client API is structured such that only one command can be outstanding and "saveEdits" have priority over "getEdits".
The speed of the network and the client diff checks can be changed to speed up or slow down the simulation to see how data are updated.
Diff Check Speed (per second)
Client version: 0
Server version: 0
Active edits: 0
Text
Shadow
Client version: 0
Server version: 0
Active edits: 0
Text
Shadow
Client 1 version: 0
Server version: 0
Active edits: 0
Text
Shadow
Queue
Log (Reverse Order)
Packet Speed (per second)
Duplicate Packet Probability
Lost Packet Probability
Out of Order Packet Probability
Server version: 0
Text
Client version: 0
Server version: 0
Backup version: 0
Active edits: 0
Shadow
Backup Shadow
Client version: 0
Server version: 0
Backup version: 0
Active edits: 0
Shadow
Backup Shadow
Client version: 0
Server version: 0
Backup version: 0
Active edits: 0
Shadow
Backup Shadow