Skip to content

Instantly share code, notes, and snippets.

View evilnapsis's full-sized avatar
😀
Trabajando ... http://evilnapsis.com

Agustin Ramos evilnapsis

😀
Trabajando ... http://evilnapsis.com
View GitHub Profile
@jpillora
jpillora / peer-data-sync.md
Last active April 12, 2017 13:48
A write up on Synchronising Data across a set of Networked Peers

Peer Data Synchronisation

One-way data synchronisation is trivial. Forward all mutating operations to your slave store to also perform them. Master-Slave replication complete.

Two-way data synchronisation - on the other hand - is hard. It involves conflict resolution, varying of complexity, from choosing the newest operation, most relavant operation, or using operational transforms. All of these require vaguely accurate time synchronisation which then produce another set of problems, solvable with comparing timers, using a shared time server, or using [atomic clocks][1].

The current problem

Currently, I'm trying to synchronise session data across multiple authentication servers. I've added to the complexity of the problem by assuming that each node is transient and may only exist for a limited amount of time (i.e. AWS deciding they need to unplug my instance). Also, the connections between each node may fail.