Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.15 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.15 KB

mdb

Warning: this project was made for learning/fun. It is not intended for serious use.

This is a key-value store implementation that I made for fun. The design is roughly based on Google's LevelDB. In particular, the KV store is backed by a log-structured merge tree on disk.

Dependencies

There is only one dependency, boost (>= 1.76.0). To compile this project, you'll need to install boost in a location that FindBoost can locate. You must build Boost.ProgramOptions and Boost.Log since these components of boost are not header-only.

This project will only compile on POSIX compliant operating systems. I did some benchmarking and found that it was much faster to do file IO with non-portable syscalls instead of with iostream.

Basic Usage

// Setup options
Options opt{
    .path = "./path/to/db_files/",
    .write_sync = false
};

DB db(opt);

// Put a key
db.Put("some key", "some value");

// Get a key
db.Get("some key");

// Delete a key (it is not an error if the key doesn't exist)
db.Delete("some key");