A Bitcask Distributed Key/Value store using Raft for consensus with a Redis compatible API written in Go. Personal fork.
Go to file
kayos@tcp.direct af69f9ad98
Logging: fix panic, add pretty output
2022-02-28 03:33:22 -08:00
tools Fixed typo in release.sh (#2) 2019-04-25 22:22:26 +10:00
.dockerignore Build minimal Docker image that runs without root priviledges (#45) 2021-02-18 18:23:39 +10:00
.gitignore Logging: fix panic, add pretty output 2022-02-28 03:33:22 -08:00
.goreleaser.yml Drop support for Windows 2021-03-16 09:42:03 +10:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md (#1) 2019-04-01 10:13:27 +10:00
CONTRIBUTING.md Create CONTRIBUTING.md 2019-04-01 10:13:14 +10:00
Dockerfile Bump golang from 1.16.4 to 1.16.5 (#55) 2021-06-08 08:44:13 +10:00
LICENSE Refactored and stripped down to work with bitcask backend 2019-03-20 18:18:33 +10:00
LICENSE.old Refactored and stripped down to work with bitcask backend 2019-03-20 18:18:33 +10:00
Makefile edit Makefile: 'make lint' runs golangci-lint (#46) 2021-02-17 16:48:45 +10:00
README.md Fix import paths 2021-07-13 08:53:57 +10:00
_config.yml Set theme jekyll-theme-hacker 2019-03-22 06:38:43 +10:00
docker-stack.yml Rename the example Docker configuration as it's actually a Docker Stack 2021-02-09 22:41:56 +10:00
go.mod Change logger, Adjust handler logic 2022-02-28 01:49:01 -08:00
go.sum Change logger, Adjust handler logic 2022-02-28 01:49:01 -08:00
main.go Logging: fix panic, add pretty output 2022-02-28 03:33:22 -08:00
server.go Logging: fix panic, add pretty output 2022-02-28 03:33:22 -08:00
version.go Refactored and stripped down to work with bitcask backend 2019-03-20 18:18:33 +10:00
version_test.go Refactored and stripped down to work with bitcask backend 2019-03-20 18:18:33 +10:00

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 git.mills.io/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 pattern
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)