All Projects → gpestana → rdoc

gpestana / rdoc

Licence: MIT license
Conflict-free replicated JSON implementation in native Go

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to rdoc

Cause
An EDN-like CRDT (Causal Tree) for Clojure & ClojureScript that automatically tracks history and resolves conflicts.
Stars: ✭ 68 (-10.53%)
Mutual labels:  distributed-systems, p2p, crdt
Nkn
Official Go implementation of NKN full node.
Stars: ✭ 287 (+277.63%)
Mutual labels:  distributed-systems, p2p
Layr
A decentralized (p2p) file storage system built atop Kademlia DHT that enforces data integrity, privacy, and availability through sharding, proofs of retrievability, redundancy, and encryption, with smart-contract powered incentive scheme
Stars: ✭ 90 (+18.42%)
Mutual labels:  distributed-systems, p2p
Nkn Client Js
[Deprecated, use nkn-sdk-js instead] JavaScript implementation of NKN client
Stars: ✭ 53 (-30.26%)
Mutual labels:  distributed-systems, p2p
nkn-shell-daemon
NKN shell daemon
Stars: ✭ 29 (-61.84%)
Mutual labels:  distributed-systems, p2p
sworm
A user-friendly distributed process registry and process supervisor
Stars: ✭ 20 (-73.68%)
Mutual labels:  distributed-systems, crdt
Lasp
Prototype implementation of Lasp in Erlang.
Stars: ✭ 876 (+1052.63%)
Mutual labels:  distributed-systems, crdt
Y Ipfs Connector
Y.js connector over IPFS
Stars: ✭ 49 (-35.53%)
Mutual labels:  p2p, crdt
Go2p
Simple to use but full configurable p2p framework
Stars: ✭ 80 (+5.26%)
Mutual labels:  distributed-systems, p2p
Diztl
Share, discover & download files in your network 💥
Stars: ✭ 162 (+113.16%)
Mutual labels:  distributed-systems, p2p
Crdt
CRDT Tutorial for Beginners (a digestible explanation with less math!)
Stars: ✭ 167 (+119.74%)
Mutual labels:  distributed-systems, crdt
Redwood
A highly-configurable, distributed, realtime database that manages a state tree shared among many peers.
Stars: ✭ 218 (+186.84%)
Mutual labels:  p2p, crdt
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+19863.16%)
Mutual labels:  p2p, crdt
privacy-preserving-primitives
primitives and protocols for implementing privacy preserving networks
Stars: ✭ 14 (-81.58%)
Mutual labels:  distributed-systems, p2p
Crdts
A library of Conflict-Free Replicated Data Types for JavaScript
Stars: ✭ 143 (+88.16%)
Mutual labels:  p2p, crdt
Rust Crdt
a collection of well-tested, serializable CRDTs for Rust
Stars: ✭ 747 (+882.89%)
Mutual labels:  distributed-systems, crdt
Peer Pad
📝 Online editor providing collaborative editing in really real-time using CRDTs and IPFS.
Stars: ✭ 564 (+642.11%)
Mutual labels:  p2p, crdt
Orbit Db
Peer-to-Peer Databases for the Decentralized Web
Stars: ✭ 6,381 (+8296.05%)
Mutual labels:  p2p, crdt
Crdt Playground
Stars: ✭ 215 (+182.89%)
Mutual labels:  distributed-systems, crdt
Testground
🧪 A platform for testing, benchmarking, and simulating distributed and p2p systems at scale.
Stars: ✭ 216 (+184.21%)
Mutual labels:  distributed-systems, p2p

rdoc

rdoc (Replicated DOCument): Build better decentralized and offline-first applications in Go

Build Status Package Version

Go Reference

rdoc is a native go implementation of a conflict-free replicated JSON data structure, as introduced by Martin Kleppmann and Alastair R. Beresford in their seminal work [1]. A JSON CRDT is "[...] an algorithm and formal semantics for a JSON data structure that automatically resolves concurrent modifications such that no updates are lost, and such that all replicas converge towards the same state (a conflict-free replicated datatype or CRDT)." [1].

Do you want to learn more about the JSON CRDT data type? This youtube video is a good introduction to the original paper [1] by Martin Kleppmann and Alastair R. Beresford.

Features

  • Simple API; One API call allows the application logic to update and manage coverging JSON replicas in decentralized settings;
  • Supports JSON Patch notation as defined in RFC6902;
  • Supports cbor serialization [WIP; v1.1.0 milestone];

Examples

// starts a new replicated JSON document with an unique ID (in the context of the replicas sample)
doc := Init("doc_replica_1")

// updates the document state with a JSON patch operation:
patch := []byte(`{"op": "add", "path": "/", "value": "user"`)
err := doc.Apply(patch)
if err != nil {
    panic(err)
}

// update the document state with remote operations (i.e. operations executed by a remote replica); 
// remote operations will update the state of the document iif all its dependencies have been applied.  
remotePath := []byte(`[
 {"op": "add", "path": "/", "value": "user", "id":"1.380503024", "deps": [] },
 {"op": "add", "path": "/name", "value": "Jane", "id":"2.1", "deps": ["1.1"] },
 {"op": "add", "path": "/name", "value": "Jane", "id":"2.380503024", "deps": ["1.380503024"] }
]`)

err := doc.Apply(remotePath)
if err != nil {
    panic(err)
}

// Get Doc operations to send over the wire; these operations can be used by
// remote replicas to converge state with `doc1`
doc1Operations := doc.Operations()

// ... apply state from doc1 into doc2, in order for replicas `doc1` and `doc2` to converge

doc2.Apply(doc1Operations)

// ...

// Native Go marshaling/unmarshaling supported 
buffer, err := json.Marshal(*doc)
if err != nil {
    panic(err)
}

References

  1. A Conflict-Free Replicated JSON Datatype (Martin Kleppmann, Alastair R. Beresford)
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].