Voltar ao ranking

loro-dev/loro

Rustloro.dev

Make your JSON data collaborative and version-controlled with CRDTs

crdtlocal-firstoffline-firstp2prich-textcollaborative-editingprivacy-first
Crescimento de estrelas
Estrelas
5.9k
Forks
157
Crescimento semanal
Issues
33
3k4k5k
nov. de 2023set. de 2024ago. de 2025jul. de 2026
Artefatoscrates.iocargo add loro
README

Loro

Make your JSON data collaborative and version-controlled 🦜

loro-dev%2Floro | Trendshift

Documentation | Getting Started | Rust Doc

https://github.com/loro-dev/loro/assets/18425020/fe246c47-a120-44b3-91d4-1e7232a5b4ac

✨ Loro 1.0 is out! Read the announcement.

Loro is a CRDTs(Conflict-free Replicated Data Types) library that makes building local-first and collaborative apps easier. You can now use it in Rust, JS (via WASM), and Swift.

Features

Features Provided by CRDTs

  • P2P Synchronization
  • Automatic Merging
  • Local Availability
  • Scalability
  • Delta Updates

Supported CRDT Algorithms

Advanced Features in Loro

https://github.com/user-attachments/assets/68e0017a-4987-4f71-b2cf-4ed28a210987

In this example, we demonstrate importing an entire Loro codebase into a Loro-powered version controller, preserving the complete Git DAG history while enabling fast version switching.

Example

Open in StackBlitz

import { expect, test } from "vitest";
import { LoroDoc, LoroList } from "loro-crdt";

test("sync example", () => {
  // Sync two docs with two rounds of exchanges

  // Initialize document A
  const docA = new LoroDoc();
  const listA: LoroList = docA.getList("list");
  listA.insert(0, "A");
  listA.insert(1, "B");
  listA.insert(2, "C");

  // Export all updates from docA
  const bytes: Uint8Array = docA.export({ mode: "update" });

  // Simulate sending `bytes` across the network to another peer, B

  const docB = new LoroDoc();
  // Peer B imports the updates from A
  docB.import(bytes);

  // B's state matches A's state
  expect(docB.toJSON()).toStrictEqual({
    list: ["A", "B", "C"],
  });

  // Get the current version of docB
  const version = docB.oplogVersion();

  // Simulate editing at B: delete item 'B'
  const listB: LoroList = docB.getList("list");
  listB.delete(1, 1);

  // Export the updates from B since the last sync point
  const bytesB: Uint8Array = docB.export({ mode: "update", from: version });

  // Simulate sending `bytesB` back across the network to A

  // A imports the updates from B
  docA.import(bytesB);

  // A has the same state as B
  expect(docA.toJSON()).toStrictEqual({
    list: ["A", "C"],
  });
});

DevTools

Loro Inspector

You can use the Loro Inspector to inspect the state and history of a Loro document.

https://github.com/user-attachments/assets/ceeb7450-80ce-42f2-aef4-2e08fa2d1f1b

Bindings

You can find bindings for other programming languages in loro-ffi.

Blog

Sponsors

Sponsors

Credits

Loro draws inspiration from the innovative work of the following projects and individuals:

  • Diamond-types: The Event Graph Walker (Eg-walker) algorithm from @josephg has been adapted to reduce the computation and space usage of CRDTs.
  • Automerge: Their use of columnar encoding for CRDTs has informed our strategies for efficient data encoding.
  • Yjs: We have incorporated a similar algorithm for effectively merging collaborative editing operations, thanks to their pioneering work.
  • Matthew Weidner: His work on the Fugue algorithm has been invaluable, enhancing our text editing capabilities.
  • Martin Kleppmann: His work on CRDTs has significantly influenced our comprehension of the field.
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.6k5.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.2k495
orbitdb/orbitdb

Peer-to-Peer Databases for the Decentralized Web

JavaScriptnpmMIT Licensep2pdistributed
8.8k597
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
tinyplex/tinybase

A reactive data store & sync engine.

TypeScriptnpmMIT Licensereactjavascript
tinybase.org
5.1k130
colanode/colanode

Open-source and local-first Slack and Notion alternative that puts you in control of your data

TypeScriptnpmApache License 2.0chatchat-application
colanode.com
5k309