mintkv 0.1.0

A simple kv library based on btree
Documentation
  • Coverage
  • 0%
    0 out of 13 items documented0 out of 7 items with examples
  • Size
  • Source code size: 89.22 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.83 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • 3Xpl0it3r

mintkv

A simple KV database in rust is based on btree, written as a learning project.

File system layout

data
|----blocks
|      b_0000001
          data
          meta.json
          index.json
          tombstone
|      b_0000002
          data
          meta.json
          index.json
          tombstone
|-----memtables (mmap)
|         m_0001
             data 
             tombstone

TODO

  • B+tree as engine
  • Memtables
  • LE128 Code
  • Blocks(disk present)
  • Wal
  • tombstone
  • compaction

Example

use mintkv::db::MintKv;
const TEST_COUNT: i32 = 1000;

fn main() {
    let mut db = MintKv::new("./data");
    for i in 0..TEST_COUNT {
        let (key, value) = (format!("key-{}", i), format!("value-{}", i));
        db.insert(&key, &value).unwrap();
    }

    for i in 0..TEST_COUNT {
        let key = format!("key-{}", i);
        let result = db.get(&key);
        println!("Search For: {}, Reesult: {:?}", key, result);
    }
}