Show HN: Tinykv – Minimal file-backed key-value store for Rust

crates.io

22 points by hasanyildiz 21 hours ago

I built tinykv because I kept reaching for simple persistent storage in Rust projects but found existing solutions either too complex (sled) or unmaintained (pickledb).

tinykv focuses on simplicity: JSON-based, serde-powered, with optional TTL. Perfect for CLI tools, game saves, config storage.

Would appreciate any feedback from the HN community!

WaxProlix 19 hours ago

Maybe a replacement for sqlite in some contexts if it's even lighter? What does tinykv do better than the current standard for file backed lightweight DB?

  • hasanyildiz 7 minutes ago

    Great question! tinykv isn't trying to replace SQLite - they serve different needs. SQLite strengths: Relational queries, ACID transactions, SQL. Complex data relationships and Multi-user concurrent access

    tinykv strengths: Zero setup (no schema, no SQL), Human-readable files (JSON - you can git diff them!), Simple key-value API, Built-in TTL support,Serde integration (any Rust type → storage)

    Use cases where tinykv fits better: CLI tool config storage, Game save files, Application preferences, Prototyping/MVP development, When you want to inspect/edit the data file manually.

    I built it because I kept reaching for simple persistence but SQLite felt like overkill for storing a HashMap<String, Value>.

porridgeraisin 13 hours ago

I love `dbm` in python for this usecase. It supports a handful of backends, including sqlite.

  • hasanyildiz 4 minutes ago

    Exactly! Python's dbm is a great comparison. tinykv aims for similar simplicity but with some Rust-specific advantages. The key difference is dbm gives you flexibility in storage format, tinykv gives you zero-ceremony type safety + readability. If you want the Python dbm experience in Rust with modern ergonomics, that's basically tinykv's sweet spot.

    Both solve the "I just need simple persistence" problem, tinykv just does it the "Rust way" with strong typing and serde.