All Projects → yongman → Leto

yongman / Leto

Licence: mit
A key value storage example powered by hashicorp raft and BadgerDB

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Leto

huffleraft
Replicated key-value store driven by the raft consensus protocol 🚵
Stars: ✭ 32 (-56.16%)
Mutual labels:  raft, hashicorp, raft-consensus-algorithm
Elasticell
Elastic Key-Value Storage With Strong Consistency and Reliability
Stars: ✭ 453 (+520.55%)
Mutual labels:  redis, raft
Dotnext
Next generation API for .NET
Stars: ✭ 379 (+419.18%)
Mutual labels:  raft, raft-consensus-algorithm
Copycat
A novel implementation of the Raft consensus algorithm
Stars: ✭ 551 (+654.79%)
Mutual labels:  raft, raft-consensus-algorithm
raft
raft is a golang library that provides a simple, clean, and idiomatic implementation of the Raft consensus protocol
Stars: ✭ 35 (-52.05%)
Mutual labels:  raft, raft-consensus-algorithm
Juicefs
JuiceFS is a distributed POSIX file system built on top of Redis and S3.
Stars: ✭ 4,262 (+5738.36%)
Mutual labels:  redis, object-storage
Finn
Fast Raft framework using the Redis protocol for Go
Stars: ✭ 534 (+631.51%)
Mutual labels:  redis, raft
Rafty
Implementation of RAFT consensus in .NET core
Stars: ✭ 182 (+149.32%)
Mutual labels:  raft, raft-consensus-algorithm
Blog
my blog, using markdown
Stars: ✭ 25 (-65.75%)
Mutual labels:  redis, raft
Javaok
必看!java后端,亮剑诛仙。java发展路线技术要点。
Stars: ✭ 867 (+1087.67%)
Mutual labels:  redis, raft
6.824 2018
MIT 6.824 2018 lab. MIT6.824分布式系统(2018秋)
Stars: ✭ 59 (-19.18%)
Mutual labels:  raft, raft-consensus-algorithm
Kites
🪁 A consistency, partition tolerance completed distributed KV store, implementation of the Raft distributed consensus protocol and Kotlin.
Stars: ✭ 41 (-43.84%)
Mutual labels:  raft, raft-consensus-algorithm
Tidis
Distributed transactional NoSQL database, Redis protocol compatible using tikv as backend
Stars: ✭ 1,182 (+1519.18%)
Mutual labels:  redis, raft
Zenko
Zenko is the open source multi-cloud data controller: own and keep control of your data on any cloud.
Stars: ✭ 353 (+383.56%)
Mutual labels:  redis, object-storage
Braft
An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Stars: ✭ 2,964 (+3960.27%)
Mutual labels:  raft, 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 (+554.79%)
Mutual labels:  raft, raft-consensus-algorithm
Mit 6.824 2018
Solutions to mit 6.824 2018
Stars: ✭ 158 (+116.44%)
Mutual labels:  raft, raft-consensus-algorithm
Atomix
A reactive Java framework for building fault-tolerant distributed systems
Stars: ✭ 2,182 (+2889.04%)
Mutual labels:  raft, raft-consensus-algorithm
Raft Java
Raft Java implementation which is simple and easy to understand.
Stars: ✭ 783 (+972.6%)
Mutual labels:  raft, raft-consensus-algorithm
Zanredisdb
Yet another distributed kvstore support redis data and index. moved to: https://github.com/youzan/ZanRedisDB
Stars: ✭ 64 (-12.33%)
Mutual labels:  redis, raft

Leto

0. What is Leto mean?

In Greek mythology, Leto (/ˈliːtoʊ/) is a daughter of the Titans Coeus and Phoebe, the sister of Asteria.

1. What is Leto?

Leto is another reference example use of Hashicorp Raft. The API is redis protocol compatiable.

Raft is a consensus algorithm that is designed to be easy to understand. It's equivalent to Paxos in fault-tolerance and performance. The difference is that it's decomposed into relatively independent subproblems, and it cleanly addresses all major pieces needed for practical systems. We hope Raft will make consensus available to a wider audience, and that this wider audience will be able to develop a variety of higher quality consensus-based systems than are available today.

2. Why do this?

You can have better comprehension about how raft protocal works if you use it. This helps me a lot.

3. Run sample

3.1 show helps

bin/leto -h
Usage of bin/leto:
  -id string
        node id
  -join string
        join to already exist cluster
  -listen string
        server listen address (default ":5379")
  -raftbind string
        raft bus transport bind address (default ":15379")
  -raftdir string
        raft data directory (default "./")

3.2 Start first node

bin/leto -id id1 -raftdir ./id1

the first node will be listen user request and node join request in port 5379, and use port 15379 for raft transport.

3.3 Start second node

bin/leto -id id2 -raftdir ./id2 -listen ":6379" -raftbind ":16379" -join "127.0.0.1:5379"

3.4 Start third node

bin/leto -id id3 -raftdir ./id3 -listen ":7379" -raftbind ":17379" -join "127.0.0.1:5379"

3.5 Test

Requst first node

redis-cli -p 5379
127.0.0.1:5379> set a b
OK
127.0.0.1:5379> get a
b
127.0.0.1:5379>

Write to second node, data has been replicated to this node. And it will return not leader error if write to it.

redis-cli -p 6379
127.0.0.1:6379> get a
b
127.0.0.1:6379> set a b
(error) not leader
127.0.0.1:6379>

Now, we shutdown the first node, the second node voted to be leader.

redis-cli -p 6379
127.0.0.1:6379> get a
b
127.0.0.1:6379> set a b
OK
127.0.0.1:6379>

4. Support commands

  • GET
  • SET
  • DELETE
  • JOIN (communicate with peer when start node)
  • LEAVE (remove dead node from raft group)
  • PING
  • SNAPSHOT (trigger snapshot mannually)
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].