Skip to content

Realtime Synchronization

John Jeng edited this page Jun 24, 2016 · 9 revisions

How SageMathCloud's Realtime Synchronization works

Whenever a user makes a change — for some definition of change — a patch is made and sent from the client to the server. The patch contains the change and when the change was made. This way if the user loses connection in the middle of some changes, patches are applied in very nearly always the correct order.

This is always well defined based on this diff-match-patch library even when patches are distributed from various computers with varying connections. That is to say, the final application of all patches is consistent based on timestamps and changes alone.

Mainly found in syncstring.coffee. It builds on synctable.coffee, which provides an interface to rethinkdb, which supports writing when offline, syncing later, merging, etc.

Clone this wiki locally