All Projects → cachapa → crdt

cachapa / crdt

Licence: Apache-2.0 License
Dart implementation of Conflict-free Replicated Data Types (CRDTs)

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to crdt

Redwood
A highly-configurable, distributed, realtime database that manages a state tree shared among many peers.
Stars: ✭ 218 (+296.36%)
Mutual labels:  crdt
slate-operational-transform
Slate Operational Transform Demo (used in production at Narration Box)
Stars: ✭ 34 (-38.18%)
Mutual labels:  crdt
netty-queue
Simple queue: java, json-rest, netty
Stars: ✭ 21 (-61.82%)
Mutual labels:  crdt
ldb
Replication of CRDTs
Stars: ✭ 37 (-32.73%)
Mutual labels:  crdt
m-ld-js
m-ld Javascript engine
Stars: ✭ 18 (-67.27%)
Mutual labels:  crdt
CRDT-Redis
CRDTs implemented in Redis
Stars: ✭ 35 (-36.36%)
Mutual labels:  crdt
Peer Base
Build real-time collaborative DApps on top of IPFS
Stars: ✭ 208 (+278.18%)
Mutual labels:  crdt
godless
Peer-to-peer lite database over IPFS
Stars: ✭ 72 (+30.91%)
Mutual labels:  crdt
caracara
GEUT LABS. An experimental Dat based collaborative editor.
Stars: ✭ 33 (-40%)
Mutual labels:  crdt
rdoc
Conflict-free replicated JSON implementation in native Go
Stars: ✭ 76 (+38.18%)
Mutual labels:  crdt
dynamic-data-and-capabilities
[ARCHIVED] Dynamic Data and Capabilities in IPFS Working Group
Stars: ✭ 57 (+3.64%)
Mutual labels:  crdt
ron
Haskell implementation of RON and RON-RDT
Stars: ✭ 65 (+18.18%)
Mutual labels:  crdt
codepair
Real-time markdown editor for interviews, meetings & more...
Stars: ✭ 50 (-9.09%)
Mutual labels:  crdt
Slate Collaborative
slatejs collaborative plugin & microservice https://slate-collaborative.herokuapp.com/
Stars: ✭ 236 (+329.09%)
Mutual labels:  crdt
diamond-types
The world's fastest CRDT. WIP.
Stars: ✭ 654 (+1089.09%)
Mutual labels:  crdt
Crdt Playground
Stars: ✭ 215 (+290.91%)
Mutual labels:  crdt
SyncedStore
SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
Stars: ✭ 1,053 (+1814.55%)
Mutual labels:  crdt
sworm
A user-friendly distributed process registry and process supervisor
Stars: ✭ 20 (-63.64%)
Mutual labels:  crdt
yorkie-js-sdk
Yorkie JavaScript SDK
Stars: ✭ 57 (+3.64%)
Mutual labels:  crdt
jylis
A distributed in-memory database for Conflict-free Replicated Data Types (CRDTs). 🌱 ↔️
Stars: ✭ 68 (+23.64%)
Mutual labels:  crdt

Dart implementation of Conflict-free Replicated Data Types (CRDTs).

This project is heavily influenced by James Long's talk CRTDs for Mortals and includes a Dart-native implementation of Hybrid Local Clocks (HLC) based the paper Logical Physical Clocks and Consistent Snapshots in Globally Distributed Databases.

It has zero external dependencies, so it should run everywhere where Dart runs.

Usage

The Crdt class works as a layer on top of a map. The simplest way to experiment is to initialise it an empty map:

import 'package:crdt/crdt.dart';

void main() {
  var crdt = MapCrdt('node_id');

  // Insert a record
  crdt.put('a', 1);
  // Read the record
  print('Record: ${crdt.get('a')}');

  // Export the CRDT as Json
  final json = crdt.toJson();
  // Send to remote node
  final remoteJson = sendToRemote(json);
  // Merge remote CRDT with local
  crdt.mergeJson(remoteJson);
  // Verify updated record
  print('Record after merging: ${crdt.get('a')}');
}

// Mock sending the CRDT to a remote node and getting an updated one back
String sendToRemote(String json) {
  final hlc = Hlc.now('another_nodeId');
  return '{"a":{"hlc":"$hlc","value":2}}';
}

You'll probably want to implement some sort of persistent storage by subclassing the Crdt class. An example using Hive is provided in hive_crdt.

Example

A simple example is provided with this project, otherwise for a real-world application check the tudo to-do app: client & server.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].