MarsDB Internals
This part of the book is for developers, or anyone curious about MarsDB’s internals. The earlier chapters tell you how to use MarsDB; this part tells you how it works: the on-disk layout, the transaction machinery, the path a Cypher statement takes from text to rows, and the reasoning behind the design decisions along the way.
A few crates, one storage engine, one query pipeline: ACID transactions, crash safety, secondary indexes, a cost-aware planner, streaming execution, and zero-copy results across three language boundaries. Every performance figure in these chapters comes from this repository’s benchmark suite.
Chapters
- Design Overview — what MarsDB is, the crate stack, the life of a statement, and the transaction model.
- The Storage Layer — redb, the thirteen tables, the transaction abstraction, backup and integrity.
- Graph Encoding — the value model, interning, the record directory format, adjacency keys.
- The Write Path — the CRUD layer, table-handle caching, mutation anatomy, the integrity checker as invariant spec.
- The Query Frontend — grammar, AST design, parameters, semantic validation.
- The IR and the Planner — logical operators,
pushdown, property indexes, index seeks, cost-based start-point
selection,
EXPLAIN. - The Executor — plan evaluation, bounded execution, three-valued logic, aggregation, the streaming lane.
- Results and Language Boundaries — the result model, the C ABI, zero-copy Arrow export.
- Testing and Measurement — the TCK, the crash harness, the benchmark ledger.
- Case Studies in Measured Trade-offs — the measurements that made (and unmade) design decisions.