bitraft (original) (raw)
2023-09-06 22:50:11 +10:00
2023-09-05 02:23:12 +10:00
2019-04-25 22:22:26 +10:00
2021-02-18 18:23:39 +10:00
2023-09-06 21:10:24 +10:00
2021-03-16 09:42:03 +10:00
2023-09-05 03:28:42 +10:00
2019-04-01 10:13:27 +10:00
2019-04-01 10:13:14 +10:00
2023-09-06 22:50:11 +10:00
2023-09-06 22:50:11 +10:00
2023-09-06 22:14:51 +10:00
2023-09-04 16:16:09 +00:00
2023-09-06 22:50:11 +10:00
2023-09-06 22:50:11 +10:00
2023-09-06 22:14:51 +10:00
2023-09-06 00:29:04 +10:00
2023-09-06 22:50:11 +10:00
A Bitcask Distributed Key/Value store using Raft for concensus using theuhaha library with aRedis compatible API written in Go.
- Redis compatible API
- Bitcask disk-based storage
- Raft support with uhaha
- Compatible with existing Redis clients
Usage
Docker
You can also use the Bitraft Docker Image:
Example session
Supported Commands
SET key value-- Set the value for the provided keyJSET key path value-- Set the value for JSON object with the provided key and pathGET key-- Teturn the value for the provided keyJGET key path-- Get the value for JSON object with the provided key and pathDEL key [key ...]-- Delete one or more keys. Returns the number of keys deleted.JDEL key path-- Delete the value of the JSON object with the provided key and pathKEYS prefix-- Return a list of all keys matching the provided prefixSTATS-- Return database statistics, e.g: number of keys, database size, etc.MONITOR-- Monitors all of the commands from all clients
JSON Documents
Bitraft also support JSON documents:
Backup and Restore
To backup data:
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-snapshotandredis-cli --pipecommands
Example:
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.