This is a small demo of how to transform a simple single-server RocksDB service written in Rust into a distributed version using OmniPaxos.

Overview

OmniPaxos Demo

This is a small demo of how to transform a simple single-server RocksDB service into a distributed version using OmniPaxos.

Related resources:

Requirements

We used the following:

  • Docker v.4.19.0 (for demo)
  • Rust 1.71.0 (for development)

Demos

Build images and start containers in detached mode:

$ docker compose up --build -d

(Note: Running this command for the first time can take a couple of minutes)

Attach to the client (network-actor) to send requests to the cluster:

$ docker attach network-actor

Client

Example network-actor CLI command:

Type a command here <put/delete/get> <args>: put a 1

Asks the cluster to write { key: "a", value: "1" }.

To send a command to a specific server, include its port at the end of the command e.g.,

get a 8001

Reads the value associated with "a" from server s1 listening on port 8001.

Demo 0: Single server

(Make sure to git checkout single-server branch before running docker compose)

  1. Propose some commands from client.
  2. In another terminal, kill the server:
$ docker kill s1
  1. In the client terminal, try sending commands again. No command succeeds because the only server is down.

Demo 1: Fault-tolerance

(Make sure to git checkout omnipaxos-replicated branch before running docker compose)

  1. Attach to a majority of the servers to observe the OmniPaxos log:
$ docker attach s2
$ docker attach s3
  1. Repeat steps 1-3 from Demo 0 (kill s1). This time, in step 3, the commands should still be successful because we still have a majority of servers running (s2 and s3).
  2. Simulate disconnection between the remaining servers by pausing s2:
$ docker pause s2
  1. Propose commands. Put and Delete will not be successful regardless of which server receives them because they cannot get committed in the log without being replicated by a majority. However, Gets from s3 still works since it's still running.
  2. Propose multiple values to the same key at both servers, e.g.,
put a 2 8002
put a 3 8003
  1. Unpause s2 and see on the servers' terminals that the concurrent modifications are ordered identically in to the OmniPaxos log.
$ docker unpause s2

Demo 2: Snapshot

(Make sure to git checkout omnipaxos-snapshot branch before running docker compose)

  1. Attach to one of the servers e.g., s3 to observe the OmniPaxos log:
$ docker attach s3
  1. Propose 5 commands from the client and see how the entries get squashed into one snapshotted entry on the server. Propose 5 more commands to see the 5 new entries get snapshotted and merged with the old snapshot.
You might also like...
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. ๐Ÿ’ก Looking for an async version? async-std https://github.c

Optimistic multi-version concurrency control (MVCC) for main memory databases, written in Rust.

MVCC for Rust This is a work-in-progress the Hekaton optimistic multiversion concurrency control library in Rust. The aim of the project is to provide

SubZero - a standalone web server that turns your database directly into a REST/GraphQL api

What is this? This is a demo repository for the new subzero codebase implemented in Rust. subZero is a standalone web server that turns your database

ChiselStore is an embeddable, distributed SQLite for Rust, powered by Little Raft.

ChiselStore ChiselStore is an embeddable, distributed SQLite for Rust, powered by Little Raft. SQLite is a fast and compact relational database manage

Raft distributed consensus algorithm implemented in Rust.
Raft distributed consensus algorithm implemented in Rust.

Raft Problem and Importance When building a distributed system one principal goal is often to build in fault-tolerance. That is, if one particular nod

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

High performance and distributed KV store w/ REST API. ๐Ÿฆ€
High performance and distributed KV store w/ REST API. ๐Ÿฆ€

About Lucid KV High performance and distributed KV store w/ REST API. ๐Ÿฆ€ Introduction Lucid is an high performance, secure and distributed key-value s

Distributed transactional key-value database, originally created to complement TiDB
Distributed transactional key-value database, originally created to complement TiDB

Website | Documentation | Community Chat TiKV is an open-source, distributed, and transactional key-value database. Unlike other traditional NoSQL sys

Aggregatable Distributed Key Generation

Aggregatable DKG and VUF WARNING: this code should not be used in production! Implementation of Aggregatable Distributed Key Generation, a distributed

open source training courses about distributed database and distributed systemes

Welcome to learn Talent Plan Courses! Talent Plan is an open source training program initiated by PingCAP. It aims to create or combine some open sour

PingCAP 8.3k Dec 30, 2022
Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres.

SDB - SignatureDB Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres

Fremantle Industries 5 Apr 26, 2022
small distributed database protocol

clepsydra Overview This is a work-in-progress implementation of a core protocol for a minimalist distributed database. It strives to be as small and s

Graydon Hoare 19 Dec 2, 2021
A mini kv database demo that using simplified bitcask storage model with rust implementation

A mini kv database demo that using simplified bitcask storage model with rust implementation.

Wancheng Long 17 Nov 28, 2022
A simplified version of a Redis server supporting SET/GET commands

This is a starting point for Rust solutions to the "Build Your Own Redis" Challenge. In this challenge, you'll build a toy Redis clone that's capable

Patrick Neilson 2 Nov 15, 2022
store virtually unlimited, large files on discord by splitting them into small chunks

Discord Drive This repo hold an MVP implementation of an concept to store data on discord by dividing them into chunks of 7MB each, which are then upl

Piyush Bhangale 5 Feb 1, 2023
Distributed SQL database in Rust, written as a learning project

toyDB Distributed SQL database in Rust, written as a learning project. Most components are built from scratch, including: Raft-based distributed conse

Erik Grinaker 4.6k Jan 8, 2023
Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD(create/read/update/delete) it using gRPC.

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD (create/ read/ update/ delete) it using gRPC. Why Create Thi

Bruce Yuan 33 Dec 16, 2022
PickleDB-rs is a lightweight and simple key-value store. It is a Rust version for Python's PickleDB

PickleDB PickleDB is a lightweight and simple key-value store written in Rust, heavily inspired by Python's PickleDB PickleDB is fun and easy to use u

null 155 Jan 5, 2023
Backend service to build customer facing dashboards 10x faster. Written in Rust.

Frolic is an open source backend service (written in Rust) to build customer facing dashboards 10x faster. You can directly connect your database to t

Frolic 133 Aug 22, 2023