A toy log structured merge tree database.
The design is based off LevelDB and RocksDB.
See db.rs for the public interface. Roughly:
DB::open(root_dir)to open a new (or reopen an existing) database, persisting the data underroot_dir.DB::put(key, value)to write akeyand associatedvalueto the database.DB::get(key)to get the value associated with thekeyDB::scan(key_prefix)to get an iterator which returns all keys which begin withkey_prefix, in sorted key order.DB::delete(key)to delete thekeyand its value.
In rough order:
- Performance
- Bloom filter for each sstable
- Concurrency
- Do compaction in the background
- SSTableReader can have multiple reads and scans in-flight
- Lock DB. Only 1 instance of the database can be opened.
- Transactions
- MVCC?
- Large values