C++17 · Crash-Safe · Benchmarked

Storage Engine

A high-performance, crash-safe key-value store with append-only log durability, on-disk indexing, log compaction, and thread-safe concurrent access.

0 Peak ops/sec
AOF Durability Model
RW Lock Thread Safety
Try the Demo How It Works
scroll to explore

Live Terminal Demo

Type commands below to interact with the simulated storage engine. Try PUT, GET, DEL, or use the action buttons.

kvstore-terminal
kvstore >
Key-Value Store State 0 keys
Key Value Offset Size
Store is empty — try a PUT command
Append-Only Log (WAL) 0 entries
Log is empty — operations will appear here

YCSB Benchmark Results

Measured using Yahoo! Cloud Serving Benchmark workloads with 100K operations each.

Workload A 50/50 Read/Write
0 ops/sec

Heavy update workload. 50% reads, 50% writes simulating session stores and user profiles.

Workload B 95/5 Read/Write
0 ops/sec

Read-heavy workload. 95% reads, 5% writes simulating photo tagging and tag exploration.

Workload C 100% Read
0 ops/sec

Read-only workload. 100% reads simulating user profile caches with external write sources.

Workload D Read Latest
0 ops/sec

Read-latest workload. Reads skew towards recently inserted records, like status updates and news feeds.

Throughput Comparison

Engine Architecture

How the storage engine achieves crash safety, durability, and performance.

Append-Only Log

All writes are serialized to an append-only file (AOF). Sequential I/O ensures high write throughput. Each entry stores: [op | key | value | size].

Durability

In-Memory Index

An std::unordered_map maps each key to its byte offset and value size in the log file for O(1) lookups.

Performance

Log Compaction

Compaction rewrites the log, keeping only the latest value for each key. Reduces disk usage and speeds up recovery.

Space Efficiency

Crash Recovery

On startup, the engine replays the append-only log from the beginning, rebuilding the in-memory index to the last consistent state.

Safety

Thread Safety

Uses std::shared_mutex for reader-writer locking. Multiple concurrent readers, exclusive writer access.

Concurrency

YCSB Benchmarking

Integrated with Yahoo! Cloud Serving Benchmark for standardized performance measurement across read/write workload mixes.

Evaluation
Data Flow
Client PUT / GET / DEL
KV Engine shared_mutex
Index unordered_map
AOF Log Sequential I/O