CRDT
Libraries for conflict-free replicated data, and a shared database built from them that any application can read and write over HTTP and WebSocket.
About
A conflict-free replicated data type, or CRDT, lets several machines change the same data at the same time and reach the same result, in any order, with no central server to settle disputes.
The shared database stores structs, tagged unions and collections in any arrangement. Each machine appends small fixed-size records to its own daily log files and never writes into another machine's; it merges what it sees from the others and serves a single merged view to its own applications.
Features
No central server
Several machines change the same data at the same time and reach the same result, whatever order the changes arrive in.
A log for each machine
Each machine appends small fixed-size records to its own daily log files, and never writes into another machine's.
One merged view
Each machine merges what it sees from the others and serves a single view to its own applications.
Structured data
Structs, tagged unions and collections in any arrangement, with references between them.
HTTP and WebSocket
Any application can read and write the shared database over HTTP and WebSocket.
Sync anywhere
Over a shared folder, or streamed directly from machine to machine.
Screenshots
crdt.org documents the libraries and the shared database down to the bytes of a record.
crdt.org
What conflict-free replicated data is, the libraries, and how the shared database works. Visit crdt.org ↗
About
The goal, which kinds of CRDT the libraries cover, the design principles and how the pieces fit together. Read about it ↗
Reference
The whole system on one page, then the data model, record format, storage layout, indexes and every operation. Open the reference ↗
Data model
Nodes, structs, collections, entries, values and references, and the rules that make merging and deletion safe. See the data model ↗
Records
Every change is a 64-byte record: its layout, node IDs, how names are encoded, and the four kinds of record. See the records ↗
Syncing
Shared folders, direct streaming, records arriving in any order, settling, and machines that go silent. See syncing ↗
The libraries
Registers
Last-write-wins and multi-value registers, with version counters and hash tie-breaks.
Sets and maps
Grow-only sets, observed-remove sets, and maps keyed by name or by node.
Counters
Increment-only and increment-decrement counters, split per machine.
Sequences
Ordered lists and collaborative text, with stable identifiers for each position.
Structured store
The node tree used by the shared database: structs, unions, collections and references.
Sync
Log files, day indexes and hash trees, over a shared folder or a direct connection.
Contents
The sections of crdt.org, and the pages in each.
About ↗
The goal, what the shared database is for, the design principles, its status and the licence.
Download ↗
The libraries and the database, coming soon.
Technologies
- Node.js - The CRDT libraries, and the database's HTTP and WebSocket server
- Go - The structured store behind the shared database
Articles
- Generating short ordered IDs with any insertion pattern - Short IDs that keep elements in order, from a naive approach to LSEQ and a tree of IDs
More research
- ReactiveJS - A small reactive framework with two-way binding and reversible calculations
- Program - A reactive programming language where values recompute themselves
- Reversibility Institute - Reversible processes across computing, manufacturing and physics