tinykv is a small key–value store written in C++.
It supports basic operations (put, get, del) with persistence using a write-ahead log (WAL) and periodic snapshots. The system is thread-safe and uses sharded locking for concurrent access. A background thread handles WAL writes.
put,get,del- Write-ahead logging (WAL) for durability
- Snapshots (checkpoints)
- Concurrent access with sharded mutexes
- Background WAL writer thread
- Simple benchmarking tool
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j./build/tinykv ./dataCommands:
put <key> <value>get <key>del <key>checkpointstatsquit
./build/tinykv_bench <db_dir> <ops> <read_frac> <threads>Example:
./build/tinykv_bench ./benchdb 500000 0.8 8This runs a multi-threaded workload and reports throughput and latency statistics.