← Tue, Nov 17 digest

Show HN: VennDB: append-only in-memory Rust DB for rows queried using bit flags

read article ↗ hn thread ↗

VennDB is a new Rust library providing an append-only, in-memory database built via derive macros, using bitmasks and bitmap indexes for high-speed boolean and tag filtering.

read it Technical readers building high-throughput routing systems will appreciate the detailed benchmark comparisons against SQLite and Roaring bitmaps.

summary

VennDB is an append-only, in-memory Rust library designed for static datasets queried via simple bit flags and filter maps. By using derive macros to generate optimized bitmasks and bitmap indices, it executes queries as set intersections without scanning full rows. Benchmarks show it significantly outperforms SQLite and manual Roaring bitmap implementations for read-heavy, low-latency lookups. However, it lacks updates or deletes, restricting its use to immutable, startup-loaded datasets.

key points

  1. Operates as an append-only, immutable in-memory database tailored for static data loaded at startup.
  2. Generates code via derive macros, turning boolean columns into bitmasks and filter values into index sets for rapid intersection queries.
  3. Benchmarks demonstrate sub-microsecond query times for multi-flag filters on one million records, outperforming SQLite and Roaring implementations.

who should read it

Rust developers and systems engineers building high-performance routing or proxy services with read-heavy, static datasets.

discussion warm

consensus

Commenters note that VennDB functions effectively as a generated bitmap index, drawing structural comparisons to Apache Druid's segment architecture.

pushback

A commenter questions whether memory bandwidth limits performance due to the lack of query reordering by selectivity or SIMD optimizations.

best comment by gopalv ↗

> It is mostly a bitmap index, generated from your struct so you don't have to write and maintain it yourself.

That explanation makes complete sense, because with this in mind, I can compare it to Apache Druid which does the same thing for data spilled onto S3.

Since this is immutable, you only had to solve "naming things", since the caches didn't need to be invalidated.

Druid is technically mutable, since it lets you mutate whole segments & then cache these bitmasks without having the original data in memory.

But if your dataset is already in memory, this is a neat implementation of an …

It contextualizes the architecture by comparing VennDB's approach to Apache Druid's segment caching.

Generated by an LLM from the article and thread. Check the sources before relying on it.