Show HN: SNKV – SQLite's B-tree as a key-value store (C/C++ and Python bindings)

Published: (February 24, 2026 at 07:59 AM EST)
1 min read

Source: Hacker News

Architecture

SQLite has six layers: SQL parser → query planner → VDBE → B-tree → pager → OS
(SQLite architecture).

For key‑value workloads you only need the bottom three. SNKV cuts the top three layers and talks directly to SQLite’s B‑tree engine. No SQL strings, no query planner, no VM—just put/get/delete on the same storage core that powers SQLite.

Python

pip install snkv
from snkv import KVStore

with KVStore("mydb.db") as db:
    db["hello"] = "world"
    print(db["hello"])   # b"world"

C / C++

#define SNKV_IMPLEMENTATION
#include "snkv.h"

KVStore *db;
kvstore_open("mydb.db", &db, KVSTORE_JOURNAL_WAL);
kvstore_put(db, "key", 3, "value", 5);

Performance (relative improvements)

OperationImprovement
Sequential writes+57%
Random reads+68%
Sequential scan+90%
Random updates+72%
Random deletes+104%
Exists checks+75%
Mixed workload+84%
Bulk insert+10%

What you get

  • ACID guarantees
  • WAL concurrency
  • Column families
  • Crash safety

All with less overhead for read‑heavy key‑value workloads.

Comments: (32 points, 19 comments)

0 views
Back to Blog

Related posts

Read more »