Giter Club home page Giter Club logo

jraft's Introduction

jraft

Yet another Raft consensus implementation

The core algorithm is implemented based on the TLA+ spec, whose safety and liveness are proven.

Supported Features,

  • Core Algorithm, safety, liveness are proven
  • Configuration Change Support, add or remove servers one by one without limitation
  • Client Request Support, to be enhanced, but is working now.
  • Urgent commit, see below
  • log compaction

Urgent Commit, is a new feature introduced by this implementation, which enables the leader asks all other servers to commit one or more logs if commit index is advanced. With Urgent Commit, the system's performance is highly improved and the heartbeat interval could be increased to seconds,depends on how long your application can abide when a leader goes down, usually, one or two seconds is fine.

About this implementation

it's always safer to implement such kind of algorithm based on Math description other than natural languge description. there should be an auto conversion from TLA+ to programming languages, even they are talking things in different ways, but they are identical

In the example of dmprinter (Distributed Message Printer), it takes about 4ms to commit a message, while in Active-Active scenario (sending messages to all three instances of dmprinter), it takes about 9ms to commit a message, the data is collected by CLT (Central Limitation Theory) with 95% of confidence level.

Code Structure

I know it's lack of documentations, I will try my best, but if you can help, let me know.

  • net.data.technology.jraft, the core algorithm implementation, you can go only with this, however, you need to implement the following interfaces,
    1. Logger and LoggerFactory
    2. RpcClient and RpcClientFactory
    3. RpcListener
    4. ServerStateManager and SequentialLogStore
    5. StateMachine
  • jraft-extensions, some implementations for the interfaces mentioned above, it provides TCP based CompletableFuture enabled RPC client and server as well as FileBasedSequentialLogStore, with this, you will be able to implement your own system by only implement StateMachine interface
  • jraft-dmprinter, a sample application, as it's name, it's distributed message printer, for sample and testing.

Planning

Here is the list of features planned for this project,

  • Implement Http Based RpcListener and RpcClient plus RpcClientFactory
  • Implement buffering for FileBasedSequentialLogStore for SequentialLogStore to improve the overall system performance
  • Implement a distributed database system by leveraging existing Java based Database system

jraft's People

Contributors

anche-is-andy avatar andy-yx-chen avatar

Watchers

James Cloos avatar damozhiying avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.