Announcing Sucredb - a database made of sugar cubes

Never mind the name or tagline. It's a project I'm working for a while now, though I would share.

Sucredb is a multi-master key-value distributed database, it provides a dynamo style tunable consistent and causality tracking.

Any node that owns a partition (replication factor) can serve both reads and writes. The database tracks causality using vector-clocks and will NOT drop any conflicting writes unlike LWW (last write wins) and other strategies. Conflicts can and will happen due to races between clients and network partitions.

4 Likes

Awesome project!

It looks like you are you thinking of supporting CRDT's? Anything potentially interesting from the Rust perspective on that?

@bluejekyll Yes, I think they're a good fit for this style of database. Providing counters, estimated distinct counts (hyperloglog) and sets wouldn't be hard and the Redis commands/clients are already built.

I'm not sure what you meant in the second question, but Rust overall is a great fit for this stuff, it's very expressive.

1 Like

I suppose I was thinking of something along the lines of a CRDT trait. It might look something like this, though I'm sure this is to simple:

trait CRDT {
    type data = T;
    type conflicts = C;

    /// *master* - is what all the data is combined into
    /// *new* - all data is moved from new into master
    /// *returns* - all conflicts during the merge
    fn merge(master: &mut T, new: T) -> C;
}

And perhaps something like a resolve method to deal with the conflicts? Just spit balling, but this could then be a trait with default impl's for Vec, HashMap, etc...