Skip to content

shanavas786/kalavara

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kalavara

Travis Status Gitlab CI crates.io

A distributed persistent key value store that speaks http. Inspired by minkeyvalue.

installation

precompiled binaries are available on release page or you can run cargo install kalavara command to install kalavara

master server

Master server stores index (key, url of volume server where the value is stored) in rocksdb. Requests are redirected to curresponding volume server after metadata is updated.

to start the server, run

master -p 6000 -d /tmp/kalavadb -v http://volume1:6001 http://volume2:6002

volume server

Volume server stores values in file system. For atomicity temporary files are first created in destdir/tmp directory and then moved to destination path. For this approach to work, destdir/tmp and destination path should be in same file system

to start the volume server, run

volume -p 7000 -d /tmp/kalavarastore

if master server is not aware of this volume server, register with

volume -p 7000 -d /tmp/kalavarastore -m http://master.server -b http://this.volume.server:7000

Usage

  1. insert a key-value
curl -XPUT -L -d value http://localhost:6000/store/key
  1. retrive value
curl -XGET -L http://localhost:6000/store/key
  1. delete a key
curl -XDELETE -L http://localhost:6000/store/key
  1. register a new volume server with master
curl -XPOST -d http://newvolume.server http://localhost:6000/admin/add-volume

Performance

./wrk -t2 -c100 -d10s http://localhost:6000/missingkey
Running 10s test @ http://localhost:6000/missingkey
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.04ms    1.61ms  28.98ms   83.07%
    Req/Sec    21.33k     4.76k   34.42k    66.00%
  426423 requests in 10.07s, 65.88MB read
  Non-2xx or 3xx responses: 426423
Requests/sec:  42359.95
Transfer/sec:      6.54MB

License

CC0

To the extent possible under law, the author(s) have dedicated all copyright related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.