Git Product home page Git Product logo

rsm's Introduction

RSM (Replicated State Machines)

Overview

Rust crate providing basic blocks for building distributed systems. It features low level primitives built on atomics as well as higher level constructs such as a Raft toolkit.

The intent is to be able to quickly incorporate non-trivial functionalities in your code, for instance being able to elect a leader or synchronize a proper draining sequence between multiple threads. There are two catches: a) the crate does not implement network I/O and you are responsible for using whatever you prefer, b) it uses half-duplex communication, e.g message passing without direct acknowledgement.

Features

  • Fast user-space synchronization primitives built on atomics: lock, read-write lock, gate, once, semaphore, events and more!
  • Basic finite state-machine automata, great for building actor systems!
  • Fast Raft protocol 100% implemented as an automaton.
  • Convenient Python frontend to act as a network I/O proxy.

Please note this is still a work in progress I am working on regularly. It is a great educational resource for whoever wants to learn how things like locks or finite state-machine work. It is not yet published on https://crates.io/ but will be soon.

Example

You often want to experiment when building your next distributed system and want to concentrate on what matter most. You can efficiently use Python as a front-end, for instance to enable gRPC I/O between your nodes, processing configuration files, etc!

The aptly named grpc example provides the protobuf API definition to encapsulate messages, a python front-end buffering over unix pipes and sub-processing a rust executable. Try it (assuming you both have python and grpc installed):

$ cargo build --bin grpc
$ cd examples
$ mkdir api
$ python -m grpc_tools.protoc -I. --python_out=./api --grpc_python_out=./api api.proto
$ python peer.py ../target/debug/grpc --id 0

Et voila, a raft peer is up and running ready to communicate to form a cluster!

Support

Contact [email protected] for more information about this project.

rsm's People

Contributors

opaugam avatar opaugam-unity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rsm's Issues

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.