Skip to content
A full implementation of CRDTs using hybrid logical clocks and a demo app that uses it
JavaScript HTML Shell
Branch: master
Clone or download
Latest commit 3acd310 Dec 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client Better background syncing Dec 9, 2019
server Revert accidental changes to server Dec 9, 2019
shared Update URLs and minor formatting Dec 5, 2019
.gitignore initial Dec 3, 2019
README.md Fix typo Dec 10, 2019
package.json initial Dec 3, 2019
run Port change Dec 9, 2019
yarn.lock Port change Dec 9, 2019

README.md

This is a demo app used for my dotJS 2019 talk "CRDTs for Mortals".

Slides here: https://jlongster.com/s/dotjs-crdt-slides.pdf

View this app here: https://crdt.jlongster.com

It contains a full implementation of hybrid logical clocks to generate timestamp for causal ordering of messages. Using these timestamps, CRDTs can be easily used to change local data that also syncs to multiple devices. This also contains an implementation of a merkle tree to check consistency of the data to make sure all clients are in sync.

It provides a server to store and retrieve messages, so that clients don't have to connect peer-to-peer.

The entire implementation is tiny, but provides a robust mechanism for writing distributed apps:

  • Server: 132 lines of JS
  • Client: 639 lines of JS

(This does not include main.js in the client which is the implementation of the app. This is just showing the tiny size of everything needed to build an app)

Links:

You can’t perform that action at this time.