Why build a database from scratch?
FlashKV is a Redis-compatible, in-memory key-value database written in Rust — no framework doing the heavy lifting, no existing storage engine underneath. It speaks the real Redis wire protocol (RESP), so redis-cli, Telnet, and any Redis client library can connect to it without knowing the difference.
I built it because tutorials stop exactly where databases get interesting. I wanted first-hand answers to four questions:
- How does one server handle thousands of concurrent connections without a thread per client?
- How do wire protocols stay fast — and what does “zero-copy parsing” actually take to implement?
- How do you make a shared data structure thread-safe without funnelling every request through one lock?
- How does key expiry work when you can never afford to scan everything?
The result is a working server with 46 Redis commands across strings, lists, key management, and server operations, a 69-test suite, Criterion benchmarks — and a 15-part documentation series in the repo explaining every design decision, written so someone else could rebuild the project from it.