crdt.org

Libraries for conflict-free replicated data, and a shared database built from them.

What is here

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. crdt.org collects small libraries for the common kinds, and one complete system built on them: a shared database of structured data that any application can read and write over HTTP and WebSocket.

The database stores structs, tagged unions and collections in any arrangement. Each service defines the shape of its own data. Every machine keeps its own files, merges what it sees from the others, and serves a single merged view to its own applications.

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.

How the shared database works

The Reference section describes the format and every operation in detail.

Start here