You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Redis-compatible distributed KV database with strong consistency, built on Raft consensus and RocksDB.
Features
Redis Protocol Compatible: Use any Redis client to connect
Distributed Consensus: Built on Raft for strong consistency
Persistent Storage: RocksDB backend for durability
Cluster Mode: Multi-node cluster with automatic failover
Quick Start
Build
cargo build --release
Configuration
CoreDB uses TOML configuration files. Example:
node_id = 1server_addr = "0.0.0.0:6379"
[raft]
address = "127.0.0.1:7001"advertise_host = "localhost"single = true# Set to false for cluster modejoin = [] # Addresses to join for cluster mode
[rocksdb]
data_path = "/tmp/coredb/node1"max_open_files = 10000
[log]
level = "info"
Configuration Fields
Field
Description
node_id
Unique node ID in the cluster
server_addr
Redis protocol listening address
raft.address
Raft consensus listening address
raft.advertise_host
Host advertised to other nodes
raft.single
Run as single node (no cluster)
raft.join
List of nodes to join for cluster mode
rocksdb.data_path
RocksDB data directory
rocksdb.max_open_files
Max open files for RocksDB
log.level
Log level (debug, info, warn, error)
Usage
Using redis-cli
# Connect to node
redis-cli -p 6379
# Set a key
SET mykey "myvalue"# Get a key
GET mykey
# Set with expiration (in seconds)
SET mykey "myvalue" EX 60
# Delete a key
DEL mykey
cd tests
# Start cluster
./start.sh start
# Check status
./start.sh status
# Stop cluster
./start.sh stop
# Clean up data
./start.sh clean
Development
Run tests
cargo test
Format code
cargo fmt
Run clippy
cargo clippy
License
Apache-2.0
About
Redis-compatible distributed key-value database built on Raft and RocksDB that provides strong consistency and automatic failover in a clustered environment.