DKV is a distributed key value store server written in Go. It exposes all its functionality over gRPC & Protocol Buffers.
- Data Sharding
- Tunable consistency
- Data replication over WANs
- createVBucket(replicationFactor)
- put(K,V,vBucket)
- del(K,vBucket)
- get(K,consistency)
- Go version 1.16+
- RocksDB v6.22.1 as a storage engine
- GoRocksDB provides the CGo bindings with RocksDB
- Badger v1.6 as a storage engine
- Nexus for sync replication over Raft consensus
Follow these instructions to launch a DKV container using the Dockerfile included.
$ curl -fsSL https://raw.githubusercontent.com/flipkart-incubator/dkv/master/Dockerfile | docker build -t dkv/dkv-deb9-amd64 -f - .
$ docker run -it dkv/dkv-deb9-amd64:latest dkvsrv --help
DKV depends on RocksDB, and its CGo bindings, so we need to install rocksdb along with its dependecies.
- Ensure HomeBrew is installed
brew install rocksdb zstd
$ mkdir -p ${GOPATH}/src/github.com/flipkart-incubator
$ cd ${GOPATH}/src/github.com/flipkart-incubator
$ git clone https://github.com/flipkart-incubator/dkv
$ cd dkv
$ make build
If you want to build for other platform, set GOOS
, GOARCH
environment variables. For example, build on macOS for linux like following:
$ make GOOS=linux build
Once DKV is built, the <PROJECT_ROOT>/bin
folder should contain the following binaries:
dkvsrv
- DKV server programdkvctl
- DKV client program
A single DKV instance can be launched using the following command:
$ ./bin/dkvsrv --config dkvsrv.yaml --db-folder <folder_name> --listen-addr <host:port>
$ ./bin/dkvctl -dkvAddr <host:port> -set <key> <value>
$ ./bin/dkvctl -dkvAddr <host:port> -get <key>
Example session:
$ ./bin/dkvsrv --config dkvsrv.yaml --db-folder /tmp/db --listen-addr 127.0.0.1:8080
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -set foo bar
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -get foo
bar
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -set hello world
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -get hello
world
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -del foo
$ ./bin/dkvctl -dkvAddr 127.0.0.1:8080 -iter "*"
hello => world
Please refer to the wiki instructions on how to run DKV in cluster mode.
Detailed documentation on specific features, design principles, data guarantees etc. can be found in the dkv Wiki
If you want to execute tests inside DKV, run this command:
$ make test
$ make GOOS=linux dist
$ make GOOS=darwin dist
dkv is undergoing active development. Consider joining the dkv-interest Google group for updates, design discussions, roadmap etc. in the initial stages of this project.