Skip to content

mikeiovine/mdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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");

About

Key-Value Store LSM-Tree Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published