• Stars
    star
    1,359
  • Rank 34,580 (Top 0.7 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

rust raft with improvements

Openraft

Advanced Raft in 🦀 Rust using Tokio. Please on github!

Crates.io docs.rs guides
CI License Crates.io Crates.io

🪵🪵🪵 Raft is not yet good enough. This project intends to improve raft as the next-generation consensus protocol for distributed data storage systems (SQL, NoSQL, KV, Streaming, Graph ... or maybe something more exotic).

Currently, openraft is the consensus engine of meta-service cluster in databend.

Status

  • Openraft API is not stable yet. Before 1.0.0, an upgrade may contain incompatible changes. Check our change-log. A commit message starts with a keyword to indicate the modification type of the commit:

    • DataChange: on-disk data types changes, which may require manual upgrade.
    • Change: if it introduces incompatible changes.
    • Feature: if it introduces compatible non-breaking new features.
    • Fix: if it just fixes a bug.
  • Branch main has been under active development.

    The main branch is for the 0.8 release.

    • The features are almost complete for building an application.
    • The performance isn't yet fully optimized. Currently, it's about 48,000 writes per second with a single writer.
    • Unit test coverage is 91%.
    • The chaos test is not yet done.
  • Branch release-0.8: Latest published: v0.8.3 | Change log v0.8.3 | ⬆️ 0.7 to 0.8 upgrade guide |

  • Branch release-0.7: Latest published: v0.7.6 | Change log v0.7.6 | ⬆️ 0.6 to 0.7 upgrade guide | release-0.7 Won't accept new features but only bug fixes.

  • Branch release-0.6: Latest published: v0.6.8 | Change log v0.6 | release-0.6 won't accept new features but only bug fixes.

Roadmap

Performance

The benchmark is focused on the Openraft framework itself and is run on a minimized store and network. This is NOT a real world application benchmark!!!

Benchmark history:

Date clients put/s ns/op Changes
2023-04-26 256 1,014,000 985
2023-04-25 64 730,000 1,369 Split channels
2023-04-24 64 652,000 1,532 Reduce metrics report rate
2023-04-23 64 467,000 2,139 State-machine moved to separate task
1 70,000 14,273
2023-02-28 1 48,000 20,558
2022-07-09 1 45,000 21,784 Batch purge applied log
2022-07-07 1 43,000 23,218 Use Progress to track replication
2022-07-01 1 41,000 23,255

To access the benchmark, go to the ./cluster_benchmark folder and run make bench_cluster_of_3.

The benchmark is carried out with varying numbers of clients because:

  • The 1 client benchmark shows the average latency to commit each log.
  • The 64 client benchmark shows the maximum throughput.

The benchmark is conducted with the following settings:

  • No network.
  • In-memory store.
  • A cluster of 3 nodes in a single process on a Mac M1-Max laptop.
  • Request: empty
  • Response: empty

Features

  • It is fully reactive and embraces the async ecosystem. It is driven by actual Raft events taking place in the system as opposed to being driven by a tick operation. Batching of messages during replication is still used whenever possible for maximum throughput.

  • Storage and network integration is well defined via two traits RaftStorage & RaftNetwork. This provides applications maximum flexibility in being able to choose their storage and networking mediums.

  • All interaction with the Raft node is well defined via a single public Raft type, which is used to spawn the Raft async task, and to interact with that task. The API for this system is clear and concise.

  • Log replication is fully pipelined and batched for optimal performance. Log replication also uses a congestion control mechanism to help keep nodes up-to-date as efficiently as possible.

  • It fully supports dynamic cluster membership changes with joint config. The buggy single-step membership change algo is not considered. See the dynamic membership chapter in the guide.

  • Details on initial cluster formation, and how to effectively do so from an application's perspective, are discussed in the cluster formation chapter in the guide.

  • Automatic log compaction with snapshots, as well as snapshot streaming from the leader node to follower nodes is fully supported and configurable.

  • The entire code base is instrumented with tracing. This can be used for standard logging, or for distributed tracing, and the verbosity can be statically configured at compile time to completely remove all instrumentation below the configured level.

Who use it

Contributing

Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.

License

Openraft is licensed under the terms of the MIT License or the Apache License 2.0, at your choosing.

More Repositories

1

databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
Rust
7,710
star
2

opendal

OpenDAL: Access data freely, painlessly, and efficiently
Rust
534
star
3

askbend

AskBend: SQL-based Knowledge Base Search and Completion using Databend
Rust
190
star
4

openkv

LSM based key-value store in rust, design for cloud
88
star
5

datafuse-presentations

Presentations, meetups and talks about Databend
HTML
72
star
6

jsonb

JSONB implement in rust
Rust
62
star
7

opensrv

opensrv for databend
Rust
58
star
8

bendsql

Databend Native Client
Rust
50
star
9

hackathon2022

Databend x Rust China Hackathon 2022
39
star
10

databend-perf

Databend Performance Data and Visualization
TypeScript
37
star
11

opencache

Cache server :)
Makefile
33
star
12

weekly

This week in Databend: an elastic and reliable cloud warehouse
25
star
13

databend-py

Databend Cloud Python Driver with native interface support
Python
19
star
14

databend-go

Golang driver for databend cloud
Go
19
star
15

wizard

A GPT4 powered tool for detecting bugs in Databend
Python
16
star
16

helm-charts

Helm charts for databend
Smarty
16
star
17

databend-sqlalchemy

Databend SQLAlchemy
Python
13
star
18

datafuse-operator

DataFuse operator manages fuse-query and fuse-store clusters atop Kubernetes using CRDs.
Go
13
star
19

datafuse-shop

datafuselabs brand toy, stickers, t-shirts etc. 🤠 👕 👓
13
star
20

databend-docs

Official repository for Databend documentation
JavaScript
12
star
21

fusebots

I am a robot
Go
12
star
22

link

Links used by databend
Go
10
star
23

databend-jdbc

jdbc implementation for databend cloud
Java
10
star
24

databend-udf

Databend User-Defined Function Server SDK
Python
8
star
25

test-infra

This repository contains tools and configuration files for the testing and automation needs for Datafuse.
Go
7
star
26

jepsen.meta

databend metasrv jepsen test unit
Shell
6
star
27

databend_fiddle

Python
5
star
28

grafana-databend-datasource

Grafana Datasource Plugin for Databend
Go
4
star
29

databend-playground

TypeScript
3
star
30

summer-of-code

Summer of Code with Datafuse Labs
1
star