GithubHelp home page GithubHelp logo

xiers / geardb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pds-lab/geardb

1.0 0.0 0.0 350 KB

GearDB: A GC-free Key-Value Store on HM-SMR Drives with Gear Compaction

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.86% Shell 1.01% C++ 94.05% C 3.08%

geardb's Introduction

GearDB

1 Introduction

This is the implementation of the paper "GearDB: A GC-free Key-Value Store on HM-SMR Drives with Gear Compaction" appeared in FAST 2019.

We implement GearDB based on LevelDB.

2 Compilation and Run

2.1 Tools

To access HM-SMR drives, GearDB uses the Libzbc library which provides functions to manipulate disks supporting ZBC and ZAC commands. To run GearDB, please download and install Libzbc first:

> git clone https://github.com/hgst/libzbc  
> sh ./autogen.sh
> ./configure
> make
> make install    //necessary

2.2 Compilation and Run

  1. If you use an HM-SMR drive (Host-managed shingled magnetic recording drive) as your storage medium, **skip this step. **If you do not have one, emulate an HM-SMR drive with your conventional HDD as following :
> cd libzbc
> zbc_set_zones /dev/sdb1 set_sz 256 256  //Block device /dev/sdb1 is an example
  1. Add the path of your HM-SMR drive or emulated HM-SMR drive (e.g., /dev/sdb1) in file "/GearDB/hm/hm_status.h":
static const char smr_filename[]="/dev/sdb1";
  1. Get the logic block size and physical block size of your HM-SMR drive. Set their sizes in file “/GearDB/hm/hm_status.h”. This is because write operations on HM-SMR drives should align with the PHYSICAL_BLOCK_SIZE and read operations on HM-SMR drives should align with the LOGICAL_BLOCK_SIZE.
#define PHYSICAL_BLOCK_SIZE 4096   
#define LOGICAL_BLOCK_SIZE 4096
  1. We have modified the Makefile to make the compilation of GearDB same with LevelDB.
> make -j4
  1. Now you may run and test GearDB with out-static/db_bench. The "out-static/libleveldb.a." is still available in GearDB.
> ./out-static/db_bench

3 GearDB's differences with LevelDB

To get the source code of LevelDB in the same edition used by GearDB, do the following steps:

> git clone https://github.com/google/leveldb
> cd leveldb
> git checkout  23162ca1c6d891a9c5fe0e0fab1193cd54ed1b4f

Or, you may download it at : https://github.com/google/leveldb/tree/23162ca1c6d891a9c5fe0e0fab1193cd54ed1b4f

Since GearDB is implemented based on LevelDB, here we list the main differences between GearDB and LevelDB.

  1. Added file: hm/*。
  2. Modified file:
db/builder.cc
db/builder.h
db/db_bench.cc
db/db_impl.cc
db/db_impl.h
db/leveldbutil.cc
db/table_cache.cc
db/table_cache.h
db/version_set.cc
db/version_set.h
include/leveldb/db.h
include/leveldb/env.h
util/env_posix.cc
util/options.cc
build_detect_platform
Makefile

4 Acknowledgement

We thank LevelDB and Libzbc!

We used them to complete our implementation.

5 Attentions

This version does not support reloading databases, which means it will get an error if you open the database again after the program finished. The version supported reloading is implemented. However, it makes the operation of GearDB a little bit cumbersome. If you test GearDB with the macro-benchmark YCSB, the reload function will be needed. You may contact [email protected] to get the support for reloading a database.

6 Contributors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.