#distributed-database #crdt #distributed #async #tokio #database #distributed-systems


Eventually consistent state replication as a library (consensus, RPC and conflict resolution) for building your own eventually consistent databases

4 releases (2 breaking)

0.5.1 Jun 22, 2023
0.4.0 Feb 26, 2023
0.2.1 Jan 6, 2023
0.2.0 Jan 6, 2023

#1113 in Concurrency

40 downloads per month
Used in 3 crates

MIT license


Datacake Cluster

A batteries included library for building your own distributed data stores or replicated state.

This library is largely based on the same concepts as Riak and Cassandra. Consensus, membership and failure detection are managed by Quickwit's Chitchat while state alignment and replication is managed by Datacake CRDT.

This library is focused around providing a simple and easy to build framework for your distributed apps without being overwhelming. In fact, you can be up and running just by implementing 1 async trait.

Basic Example

use std::net::SocketAddr;
use datacake_node::{Consistency, ConnectionConfig, DCAwareSelector, DatacakeNodeBuilder};
use datacake_eventual_consistency::test_utils::MemStore;
use datacake_eventual_consistency::EventuallyConsistentStoreExtension;

async fn main() -> anyhow::Result<()> {
    let addr = "".parse::<SocketAddr>().unwrap();
    let connection_cfg = ConnectionConfig::new(addr, addr, Vec::<String>::new());
    let node = DatacakeNodeBuilder::<DCAwareSelector>::new(1, connection_cfg)
        .expect("Connect node.");

    let store = node
        .expect("Create store.");
    let handle = store.handle();

            b"Hello, world! From keyspace 1.".to_vec(),
        .expect("Put doc.");

Complete Examples

Indepth examples can be found here.


~251K SLoC