SNKV – SQLite's B-tree as a key-value store (C/C++ and Python bindings)
SQLite B-tree without SQL: 57–68% faster KV ops, single-header drop-in.
SNKV — a lightweight key-value store focused on simplicity, security and performance file based database , written using b-tree directly. Now supports vector HNSW , Join the discussion: https://discord.gg/EUb4Y5qE
SQLite's proven storage minus SQL parsing—3–5× throughput for KV-only workloads.
C/C++ developers needing persistent, crash-safe KV storage without server overhead
RocksDB · LevelDB · SQLite native API
https://github.com/hash-anu/snkv
### Why I built this
I wanted something as simple as a hashmap, but:
* persistent * crash-safe * no external dependencies * easy to drop into any C/C++ project
Most KV stores are either:
* too heavy (servers, background processes), or * too low-level (you manage everything)
snkvDB tries to sit in between.
---
### What it is
* Single-header KV store (just include and use) * ACID compliant (thanks to SQLite) * No server, no config, no build system required * Works like a simple embedded database
---
### Under the hood
snkvDB is built on SQLite’s storage engine (B-Tree backend), so you get:
* durability * transactions * mature, battle-tested storage
But the API is simplified to a minimal KV interface.
---
### When to use it
* Embedding storage in CLI tools or small apps * Replacing ad-hoc file storage * Lightweight persistence without running a DB server
---
### Benchmarks
I’ve compared it with RocksDB and LMDB here: https://github.com/hash-anu/snkv
TL;DR:
* Faster than RocksDB for small/medium workloads * Easier to use than LMDB * Balanced read/write performance
---
### Trade-offs
* Not for write-heavy, high-throughput workloads (RocksDB is better there) * LMDB can be faster for pure reads * This prioritizes simplicity + safety over raw performance
---
Would love feedback, especially on:
* API design * performance * real-world use cases
SQLite B-tree without SQL: 57–68% faster KV ops, single-header drop-in.
LSM-tree with SSI, column families, and adaptive compaction—solid database primitives, nothing novel.
FoundationDB layer enabling ACID transactions across documents and key-values with Redis protocol.
Yet another benchmarking tool, but specifically for key-value stores instead of databases.
Skip SQL entirely; direct B-tree KV API cuts RocksDB memory from 121MB to 11MB.
Educational LSM implementation in pure Go; zero production use case demonstrated.