Need help with bitraft?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

prologic
315 Stars 15 Forks MIT License 77 Commits 2 Opened issues

Description

🎉A Bitcask Distributed Key/Value store using Raft for consensus with a Redis compatible API written in Go.

Services available

!
?

Need anything else?

Contributors list

# 2,921
Docker
golang
barge
React
34 commits
# 3,108
Go
golang
Shell
Redis
23 commits
# 5,545
Go
adafrui...
ifttt
gui-fra...
2 commits

bitraft

Go Report Card GitHub license Github all releases

A Bitcask Distributed Key/Value store using Raft for concensus with a Redis compatible API written in Go.

Based off of kvnode. (See LICENSE.old)

  • Redis compatible API
  • Bitcask disk-based storage
  • Raft support with Finn commands
  • Compatible with existing Redis clients

Usage

$ go get github.com/prologic/bitraft
$ bitraft

Docker

You can also use the Bitraft Docker Image:

$ docker pull prologic/bitraft
$ docker run -d -p 4920:4920 prologic/bitraft

Example session

Commands:

SET key value
GET key
DEL key [key ...]
KEYS [WITHVALUES]
FLUSHDB
SHUTDOWN

Backup and Restore

To backup data:

RAFTSNAPSHOT
This will creates a new snapshot in the
data/snapshots
directory. Each snapshot contains two files,
meta.json
and
state.bin
. The state file is the database in a compressed format. The meta file is details about the state including the term, index, crc, and size.

Ideally you call

RAFTSNAPSHOT
and then store the state.bin on some other server like S3.

To restore: - Create a new raft cluster - Download the state.bin snapshot - Pipe the commands using the

bitraft --parse-snapshot
and
redis-cli --pipe
commands

Example:

bitraft --parse-snapshot state.bin | redis-cli -h 10.0.1.5 -p 4920 --pipe

This will execute all of the

state.bin
commands on the leader at
10.0.1.5:4920

For information on the

redis-cli --pipe
command see Redis Mass Insert.

License

bitraft source code is available under the MIT License.

Previously based off of kvnode. (See LICENSE.old)

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.