A distributed go-datastore implementation using Merkle-CRDTs.
go-ds-crdt
is a key-value store implementation using Merkle CRDTs, as
described in
the paper by Héctor Sanjuán, Samuli Pöyhtäri and Pedro Teixeira.
It satisfies the
Datastore
and Batching
interfaces from go-datastore
.
Internally it uses a delta-CRDT Add-Wins Observed-Removed set. The current value for a key is the one with highest priority. Priorities are defined as the height of the Merkle-CRDT node in which the key was introduced.
go-ds-crdt
needs:
- A user-provided, thread-safe,
go-datastore
implementation to be used as permanent storage. We recommend using the Badger implementation. - A user-defined
Broadcaster
component to broadcast and receive updates from a set of replicas. If your application uses libp2p, you can use libp2p PubSub and the providedPubsubBroadcaster
. - A user-defined
DAGSyncer
component to publish and retrieve Merkle DAGs to the network. For example, you can use IPFS-Lite which casually satisfies this interface.
The permanent storage layout is optimized for KV stores with fast indexes and key-prefix support.
See https://godoc.org/github.com/ipfs/go-ds-crdt for more information.
This project is captained by @hsanjuan.
This library is dual-licensed under Apache 2.0 and MIT terms.
Copyright 2019. Protocol Labs, Inc.