All Projects → brianbinbin → Raf

brianbinbin / Raf

Licence: other
An Elixir library which implements the Raft consensus protocol

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Raf

Copycat
A novel implementation of the Raft consensus algorithm
Stars: ✭ 551 (+1569.7%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
Kites
🪁 A consistency, partition tolerance completed distributed KV store, implementation of the Raft distributed consensus protocol and Kotlin.
Stars: ✭ 41 (+24.24%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
Ra
A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Stars: ✭ 478 (+1348.48%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
6.824 2018
MIT 6.824 2018 lab. MIT6.824分布式系统(2018秋)
Stars: ✭ 59 (+78.79%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
Mit6.824 distributedsystem
MIT6.824分布式系统(2018秋)
Stars: ✭ 135 (+309.09%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
Atomix
A reactive Java framework for building fault-tolerant distributed systems
Stars: ✭ 2,182 (+6512.12%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
Mit 6.824 2018
Solutions to mit 6.824 2018
Stars: ✭ 158 (+378.79%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
huffleraft
Replicated key-value store driven by the raft consensus protocol 🚵
Stars: ✭ 32 (-3.03%)
Mutual labels:  distributed-systems, raft-consensus-algorithm
b-rabbit
A thread safe library that aims to provide a simple API for interfacing with RabbitMQ. Built on top of rabbitpy, the library make it very easy to use the RabbitMQ message broker with just few lines of code. It implements all messaging pattern used by message brokers
Stars: ✭ 15 (-54.55%)
Mutual labels:  distributed-systems
Gauntlet
🔖 Guides, Articles, Podcasts, Videos and Notes to Build Reliable Large-Scale Distributed Systems.
Stars: ✭ 336 (+918.18%)
Mutual labels:  distributed-systems
NautilusCSharp
The open-core for enterprise-grade algorithmic trading infrastructure
Stars: ✭ 16 (-51.52%)
Mutual labels:  distributed-systems
file management sys
file_management_sys 是一个文件共享系统,包括前端文件展示系统和后台管理系统,基于SpringBoot + MyBatis实现。前端文件展示系统包括文件分类和展示界面,文件搜索和文件上传等模块。后台管理系统包含文件管理,权限管理等模块。
Stars: ✭ 60 (+81.82%)
Mutual labels:  distributed-systems
fjage
Framework for Java and Groovy Agents
Stars: ✭ 19 (-42.42%)
Mutual labels:  distributed-systems
Systemizer
A system design tool that allows you to simulate data flow of distributed systems.
Stars: ✭ 1,219 (+3593.94%)
Mutual labels:  distributed-systems
foremast-brain
Foremast-brain is a component of Foremast project.
Stars: ✭ 17 (-48.48%)
Mutual labels:  distributed-systems
research
distributed system;blokchain;filecoin/ipfs,...
Stars: ✭ 39 (+18.18%)
Mutual labels:  distributed-systems
IoTPy
Python for streams
Stars: ✭ 24 (-27.27%)
Mutual labels:  distributed-systems
Distributed-System-Algorithms-Implementation
Algorithms for implementation of Clock Synchronization, Consistency, Mutual Exclusion, Leader Election
Stars: ✭ 39 (+18.18%)
Mutual labels:  distributed-systems
hlclock
Hybrid Logical Clocks for Elixir
Stars: ✭ 46 (+39.39%)
Mutual labels:  distributed-systems
reacted
Actor based reactive java framework for microservices in local and distributed environment
Stars: ✭ 17 (-48.48%)
Mutual labels:  distributed-systems

Raf

Overview

Raf is an Elixir implementation of the Raft distributed consensus protocol. It provides users with an api for building consistent (2F+1 CP), distributed state machines. Raft protocol is described in the original paper.

Features

  • Leader election
  • Log replication
  • Configuration changes

Installation

If available in Hex, the package can be installed by adding raf to your list of dependencies in mix.exs:

def deps do
  [
    {:raf, "~> 0.1.0"}
  ]
end

Example

Launch 3 nodes

$ iex --sname peer1@localhost -S mix
iex(peer1@localhost)1> Raf.start_test_node(:peer1)

$ iex --sname peer2@localhost -S mix
iex(peer2@localhost)1> Raf.start_test_node(:peer2)

$ iex --sname peer3@localhost -S mix
iex(peer3@localhost)1> Raf.start_test_node(:peer3)

when peers have been running. You can check peers' status:

:sys.get_status(:peer1)
or
:sys.get_state(:peer1)

Config cluster

At this point all the peers are in the follow state. In order to get them to communicate we need to define a cluster configuration. In our case, we'll run on node peer1:

peers = [{:peer1, :peer1@localhost},
        {:peer2, :peer2@localhost},
        {:peer3, :peer3@localhost}]
Raf.set_config(:peer1, peers)

Once election is done. You can see who is the current leader:

iex(peer2@localhost)3> Raf.get_leader(:peer2)
{:peer1, :peer1@localhost}

Write Operations

# Create a new ets table
Raf.write(:peer1, {:new, :sometable})

# Store an erlang term in that table
Raf.write(:peer1, {:put, :sometable, :somekey, :someval})

# Delete a term from the table
Raf.write(:peer1, {:delete, :sometable, :somekey})

# Delete a table
Raf.write(:peer1, {:delete, :sometable})

Read Operations

# Read an erlang term
Raf.read(:peer1, {:get, :sometable, :somekey})

# list tables
Raf.read(:peer1, :list_tables)

# list keys
Raf.read(:peer1, {:list_keys, :somekey})
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].