Hybrid indexing
Bitmap, PGM, FM, HNSW, Sparse/SPLADE, and MinHash secondary indexes, plus a dedicated primary-key path, all resolve through the same RowId space, making mixed predicates practical inside one engine.
A local database for writes, scans, search, vectors, ranges, and encrypted storage.
MongrelDB is an open source embedded database for applications that need more than key-value lookup, but do not want to operate a separate service for every access pattern. Store data locally, query it with SQL or native APIs, and combine equality, range, text, vector, and sparse retrieval in one engine.
Embedded databases are strongest when they stay close to the application. MongrelDB keeps that deployment model while adding the access paths modern software often has to bolt on later. It is an independent engine, not a MongoDB fork or MongoDB-compatible replacement.
Bitmap, PGM, FM, HNSW, Sparse/SPLADE, and MinHash secondary indexes, plus a dedicated primary-key path, all resolve through the same RowId space, making mixed predicates practical inside one engine.
Fast scans should not require giving up direct writes. MongrelDB uses a WAL and memtable in front of immutable PAX-columnar .sr runs.
ENCRYPTED_INDEXABLE columns use equality and range tokens to narrow candidate rows before plaintext is required.
Use SQL through DataFusion, Arrow IPC for batches, and NAPI bindings for Node. Keep local data local until your application needs to move it.
Cross-table commits stage on the shared WAL. Choose ReadCommitted, RepeatableRead, or Serializable (SSI-style certification), with savepoints and durable idempotent commits.
Beyond boolean intersection: named retrievers fuse with reciprocal-rank fusion, with optional exact-vector rerank and scored SQL table functions like hybrid_search_scored.
Evidence-led guides explain where embedded storage helps, where it does not, and how to evaluate vector retrieval, encryption, Node.js, MCP, and mixed workloads without hiding the tradeoffs.
Separate test-process compatibility from a real production embedded database.
HNSW, SQL filters, sparse retrieval, transactions, and exact reranking in Rust.
Choose loopback HTTP or stdio, then secure the write-capable tool boundary.
Understand equality and range tokens, candidate narrowing, and leakage.
Operational writes and analytical scans in one process, with explicit limits.
Run HNSW, metadata filters, transactions, and SQL through a native Node addon.
Compare SQL, document, NoSQL, key-value, analytical, and vector workloads.
Evaluate SQLite-like extensions, vector stores, ANN libraries, and hybrid engines.
Choose free, open-source local retrieval by persistence, filtering, and recovery.
Fuse full-text, sparse, vector, literal, equality, and range retrieval.
Threat-model embeddings, ANN artifacts, WAL, metadata, keys, and backups.
Each index returns RowIds, so the engine can combine filters without forcing every workload through a single data structure.
The HOT module resolves primary keys directly into the shared RowId space. The height-optimized trie it is named for is a planned drop-in; today's build runs a correct ordered-map back end behind the same surface.
Low-cardinality values compress into Roaring bitmaps, turning equality filters into set operations instead of table walks.
A shrinking-cone, epsilon-bounded learned model predicts where range keys live, then resolves qualifying rows into RowIds.
BWT plus wavelet-tree substring search lets containment queries use an index instead of falling back to a full scan.
Semantic similarity search lives beside text, equality, and range filters instead of requiring a separate vector database.
SPLADE-style sparse top-k retrieval with pluggable tokenization brings inverted-token scoring into the same engine as dense vectors, substring search, and ordinary filters.
MinHash supports approximate set similarity for deduplication and join-style retrieval, then returns RowIds like the other access paths.
A vector match, substring filter, tenant predicate, and time range can all be represented as candidate RowId sets. MongrelDB intersects those sets first, then decodes the rows that remain.
When ranking matters more than set membership, named scored retrievers — ANN, sparse, and MinHash — fuse with deterministic reciprocal-rank fusion, and an optional stage reranks a bounded candidate window against exact stored vectors. The same machinery backs table.search in the Node addon and scored SQL table functions such as ann_search_scored and hybrid_search_scored.
The write path is log-structured. The read path resolves predicates to shared RowIds, decodes only the columns needed for the result, and keeps frequently requested answers close by.
Durability starts with an append-only write-ahead log that can batch fsync work.
A composite-key (RowId, Epoch) MVCC Bε-tree memtable buffers updates in bulk before a packed-memory-array mutable-run tier coalesces small flushes into immutable runs.
Sorted-run pages support scans, compression, and projection pushdown in the embedded storage layer.
Equality, range, substring, vector, and sparse matches can be intersected before row decoding.
SQL, Arrow IPC, and Node-native bindings provide familiar ways to work with local data.
Query AS OF EPOCH snapshots, set retention and TTL policies, and restore from backups with point-in-time recovery.
MongrelDB keeps durable writes in front of compressed runs, so applications can support updates and analytical reads in the same local store. A durable single-row update on a flushed table measures 4.28 ms.
Memory-mapped runs, adaptive encodings, projection pushdown, page pruning, and a warm result cache keep read paths inside the embedded engine.
Single-machine engineering measurements from BENCHMARKS.md in the repository, not cross-machine guarantees. Durable means fsync; accepted writes acknowledge before it.
MongrelDB is designed to protect stored pages, authenticate metadata, and still let trusted predicates narrow work without decrypting the entire dataset first.
Page-level AES-256-GCM protects sorted-run payloads, WAL segments, result cache entries, and index checkpoints. Run metadata is authenticated so tampering can be detected on open.
Encrypted-indexable columns expose query tokens so equality and range predicates can resolve candidate rows without requiring a full decrypt-first scan.
Run metadata is authenticated, while encrypted page payloads are individually protected with AES-GCM tags.
Delta, Dictionary, Zstd, and passthrough encodings can be selected per column, while memory-mapped runs and a metadata count path keep the embedded profile lean.
The optional server adds users and roles with GRANT/REVOKE SQL, OIDC/JWKS sign-in, HashiCorp Vault Transit as an external key-management service, TLS 1.3 with optional mutual TLS, and a bounded audit log.
Use SQL when it is enough, native calls when query shape matters, and Arrow when columnar data needs to move efficiently.
MongrelDB fits local-first apps, edge jobs, desktop tools, test harnesses, agent workflows, and Node services that benefit from embedded storage without a database server to operate.
// Open one local database. Combine multiple access paths.
const { Database, ConditionKind } = require("@visorcraft/mongreldb");
const db = Database.open("./app-data");
const docs = db.table("docs");
const hits = docs.search({
must: [
{ kind: ConditionKind.FmContains, columnId: 2, text: "needle" },
{ kind: ConditionKind.BitmapEq, columnId: 3, text: "acme" },
{ kind: ConditionKind.RangeInt, columnId: 4, int64Lo: fromTs, int64Hi: toTs },
],
retrievers: [
{ kind: "ann", columnId: 5, name: "semantic", weight: 1, k: 50, embedding: query },
],
limit: 20,
});
console.log(hits.length);
Embedded is the default, not the ceiling. The same engine ships behind an optional daemon with a TLS 1.3 native gRPC listener (OIDC or SCRAM sign-in), a MySQL wire-compatible TLS listener with an online migration tool, and async WAL replication into Raft-replicated HA or a tablet-sharded cluster — the cluster paths are exercised under deterministic simulation and fault injection.
Stated plainly: distributed serializable transactions cover the landed path, and published failover timings are single-machine test-harness measurements, not deployment promises.
MongrelDB stays open source whichever tool you choose. Start with the focused, free Viewer, or use Mongrel when your database work extends into other engines and infrastructure.
Open a local MongrelDB folder or connect to mongreldb-server. Browse schemas and rows, run SQL, inspect indexes, and handle REINDEX and ANN maintenance in a focused desktop app for Linux, macOS, and Windows.
Use Mongrel when MongrelDB is one part of a broader workflow. Manage it alongside 30+ database engines, terminal and remote-file connections, Docker, Podman, Kubernetes, and API clients from one desktop workspace.
Explore the code, run the benchmarks, and try it against a workload that needs local writes, hybrid search, and analytical scans in one embedded database.