Voltar ao ranking

josephg/diamond-types

Rust

The world's fastest CRDT. WIP.

crdtcollaborative-editing
Crescimento de estrelas
Estrelas
1.8k
Forks
42
Crescimento semanal
Issues
13
5001k1.5k
jul. de 2020jul. de 2022jul. de 2024jul. de 2026
Artefatoscrates.iocargo add diamond-types
README

Diamond Types

📦 Cargo package

📖 Documentation on docs.rs

🇳 NodeJS package on npm (via WASM)

🌐 Web browser package on npm (via WASM)

This repository contains a high performance rust CRDT for text editing. This is a special data type which supports concurrent editing of lists or strings (text documents) by multiple users in a P2P network without needing a centralized server.

This version of diamond types only supports plain text editing. Work is underway to add support for other JSON-style data types. See the more_types branch for details.

This project was initially created as a prototype to see how fast a well optimized CRDT could be made to go. The answer is really fast - faster than other similar libraries. This library is currently in the process of being expanded into a fast, feature rich CRDT in its own right.

For detail about how to use diamond types, see the package level documentation at docs.rs.

Note the package published to cargo is quite out of date, both in terms of API and performance.

For much more detail about how this library works, see:

As well as being lightning fast, this library is also designed to be interoperable with positional updates. This allows simple peers to interact with the data structure via operational transform.

Internals

Each client / device has a unique ID. Each character typed or deleted on each device is assigned an incrementing sequence number (starting at 0). Each character in the document can thus be uniquely identified by the tuple of (client ID, sequence number). This allows any location in the document to be uniquely named.

The internal data structures are designed to optimize two main operations:

  • Text edit to CRDT operation (Eg, "user A inserts at position 100" -> "user A seq 1000 inserts at (B, 50)")
  • CRDT operation to text edit ("user A seq 1000 inserts at (B, 50)" -> "insert at document position 100")

Much more detail on the internal data structures used is in INTERNALS.md.

LICENSE

This code is published under the ISC license.

Acknowledgements

This work has been made possible by funding from the Invisible College.

Repositórios relacionados
toeverything/AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

TypeScriptnpmOthereditorcrdt
affine.pro
70.7k5.1k
pubkey/rxdb

The local-first database that runs on every JS runtime and replicates with your existing backend - no vendor, no lock-in - https://rxdb.info/

TypeScriptnpmApache License 2.0databasenosql
rxdb.info
23.3k1.2k
yjs/yjs

Shared data types for building collaborative software

JavaScriptnpmOtheryjscrdt
docs.yjs.dev
22.2k791
amark/gun

An open source cybersecurity protocol for syncing decentralized graph data.

JavaScriptnpmOthermachine-learningartificial-intelligence
gun.eco/docs
19.1k1.2k
automerge/automerge-classic

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.

JavaScriptnpmMIT Licensecrdtjavascript
automerge.org
14.7k460
electric-sql/electric

The agent platform built on sync.

TypeScriptnpmApache License 2.0elixirpostgres
electric.ax
10.3k349
berty/berty

Berty is a secure peer-to-peer messaging app that works with or without internet access, cellular data or trust in the network

TypeScriptnpmOtherbertyipfs
berty.tech
9.2k496
orbitdb/orbitdb

Peer-to-Peer Databases for the Decentralized Web

JavaScriptnpmMIT Licensep2pdistributed
8.8k596
supabase/realtime

Broadcast, Presence, and Postgres Changes via WebSockets

ElixirApache License 2.0elixirpostgres
supabase.com/realtime
7.6k451
toeverything/blocksuite

🧩 Content editing tech stack for the web - BlockSuite is a toolkit for building editors and collaborative applications.

TypeScriptnpmMozilla Public License 2.0blockcollaboration
blocksuite.io
5.9k559
loro-dev/loro

Make your JSON data collaborative and version-controlled with CRDTs

Rustcrates.ioMIT Licensecrdtlocal-first
loro.dev
5.9k159
tinyplex/tinybase

A reactive data store & sync engine.

TypeScriptnpmMIT Licensereactjavascript
tinybase.org
5.1k130