Home▸Distributed & Parallel Computing▸Merkle Tree Sync 2D: Reconciling Offline-Diverged Replicas

Merkle Tree Sync 2D: Reconciling Offline-Diverged Replicas

2D companion to the Merkle-tree anti-entropy sync model: watch two flat hash-tree diagrams compare subtrees top-down on a pannable/zoomable canvas, pruning whole matching branches so only the handful of records that changed offline ever get transferred.

Distributed & Parallel Computing2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-offline ↗ Open standalone

When a mobile client or database node goes offline and keeps working, its local copy of the data drifts away from the server's copy — but re-syncing shouldn't mean comparing every single record over the network. This 2D simulator draws two flat binary hash trees, one per replica, where every leaf hashes a record and every internal node hashes its children. Take Replica A offline, let random edits accumulate on it, then run the sync: the algorithm walks both trees from the root and prunes any subtree whose hash still matches, only descending into branches that actually diverged and only transferring the handful of leaf records that changed. Live counters compare the number of hash comparisons actually performed against a naive full linear scan, showing exactly why this is the mechanism real distributed databases (Cassandra, DynamoDB, CouchDB) use for anti-entropy repair. Drag to pan and scroll to zoom the diagram, same as the 3D version's orbit controls.

⚙ Under the hood

2D companion to the Merkle-tree anti-entropy sync model: watch two flat hash-tree diagrams compare subtrees top-down on a pannable/zoomable canvas, pruning whole matching branches so only the handful of records that changed offline ever get transferred.

merkle-treeanti-entropyoffline-syncdistributed-systemshash-treecomputer-science2d-simulation

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)