Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by Retr0id on Tuesday February 24, 2026 @08:22AM
(#47136819)
What does "column family" mean in this context?
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by swaminarayan on Tuesday February 24, 2026 @08:23AM
(#47136838)
A named key space within the same database file — keys in "users" don't
collide with keys in "sessions" but both share the same WAL and transaction.
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by bflesch on Tuesday February 24, 2026 @08:27AM
(#47136872)
Did you measure the performance impact of having multiple trees in a single file vs. having one tree per file? I'd assume one per file is faster, is that correct?
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by swaminarayan on Tuesday February 24, 2026 @09:11AM
(#47137374)
no dont know about it. I will check it out.
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by d1l on Tuesday February 24, 2026 @08:23AM
(#47136826)
Are you using ai for the comment replies too?!
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by derwiki on Tuesday February 24, 2026 @08:32AM
(#47136937)
Everyone knows the emdash is a giveaway, and they are being left in
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by altmanaltman on Tuesday February 24, 2026 @08:24AM
(#47136845)
are you reading what you're writing?
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by d1l on Tuesday February 24, 2026 @08:26AM
(#47136865)
It's a nonstop slop funnel as far as I can tell. Only ashamed I've been here for more than 5 minutes.
Re:Show HN: SNKV – SQLite's B-tree as a key-value store (C/C...
by swaminarayan on Tuesday February 24, 2026 @09:12AM
(#47137385)
yes
The SQL layer overhead alone is probably small, you're right. The bigger gain comes from a cached read cursor. SQLite opens and closes a cursor on every operation. SNKV keeps one persistent cursor per column family sitting open on the B-tree. On random deletes that means seek + delete on an already warm cursor vs. initialize cursor + seek + delete + close on every call.
For deletes there's also prepared statement overhead in SQLite — even with prepare/bind/step/reset, that's extra work SNKV just doesn't do.
I'd genuinely like someone else to run the numbers. Benchmark source is in the repo if you want to poke at it — tests/test_benchmark.c on the SNKV side and https://github.com/hash-anu/sqllite-benchmark-kv for SQLite. If your results differ I want to know.