Enabling Efficient Updates in Key-value Storage via Hashing
The prototype is written in C++ and uses 3rd parity libraries, including
Minimal requirement to test the prototype:
- Ubuntu 14.04 LTS (Server)
- 1GB RAM
- On Ubuntu 14.04 LTS (Server), install
- C++ compiler:
g++(version 4.8.4 or above) - Boost library:
libboost-system-dev,libboost-filesystem-dev,libboost-thread-dev - Snappy:
libsnappy-dev - CMake (required to compile HdrHistogram_c):
cmake - Zlib (required to compile HdrHistogram_c):
zlib1g-dev
- C++ compiler:
$ sudo apt-get update
$ sudo apt-get install g++ libboost-system-dev libboost-filesystem-dev libboost-thread-dev libsnappy-dev cmake zlib1g-dev- Download and extract the source code tarball (./hashkv-*.tar.gz)
$ tar zxf hashkv-*.tar.gz- Setup the environment variable for HashKV as the root directory of folder
hashkv
$ cd hashkv
$ export HASHKV_HOME=$(pwd)- Compile HdrHistogram_c (
libhdr_histogram.so) underlib/HdrHistogram_c-0.9.4,
$ cd ${HASHKV_HOME}/lib/HdrHistogram_c-0.9.4
$ cmake .
$ make- Compile LevelDB (
libleveldb.so) underlib/leveldb,
$ cd ${HASHKV_HOME}/lib/leveldb
$ make- Compile the prototype and the test program.
$ cd ${HASHKV_HOME}
$ makeThe test program is generated under bin/ after compilation, named hashkv_test.
- Before running, add path to shared libraries under
lib/leveldb/out-sharedandlib/HdrHistogram_c-0.9.4/src:
$ export LD_LIBRARY_PATH="$HASHKV_HOME/lib/leveldb/out-shared:$HASHKV_HOME/lib/HdrHistogram_c-0.9.4/src:$LD_LIBRARY_PATH"- Then, switch to folder
bin/
$ cd ${HASHKV_HOME}/bin- Create the folder for key storage (LSM-tree), which is named
leveldbby default
$ mkdir leveldb- Create the folder for value storage
$ mkdir data_dir- Clean the LSM-tree and the value storage folders before run
$ rm -f data_dir/* leveldb/*- Choose and copy one of the example configuration files
[db_sample_config.ini]corresponding to different designs
- HashKV:
hashkv_sample_config.ini - vLog:
vlog_sample_config.ini - LevelDB:
leveldb_sample_config.ini
$ cp [db_sample_config.ini] config.ini- Run the test program of the prototype under the chosen design
$ ./hashkv_test data_dir 100000You can repeat steps 6-8 to try other designs.
Note that since the data layout differs between designs, the LSM-tree and the value store folders must be cleared when one switches to another design.
See our papers for greater design details of HashKV:
- Helen H. W. Chan, Yongkun Li, Patrick P. C. Lee, and Yinlong Xu. HashKV: Enabling Efficient Updates in KV Storage via Hashing (USENIX ATC 2018)