Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

  1. Design Overview — what MarsDB is, the crate stack, the life of a statement, and the transaction model.
  2. The Storage Layer — redb, the thirteen tables, the transaction abstraction, backup and integrity.
  3. Graph Encoding — the value model, interning, the record directory format, adjacency keys.
  4. The Write Path — the CRUD layer, table-handle caching, mutation anatomy, the integrity checker as invariant spec.
  5. The Query Frontend — grammar, AST design, parameters, semantic validation.
  6. The IR and the Planner — logical operators, pushdown, property indexes, index seeks, cost-based start-point selection, EXPLAIN.
  7. The Executor — plan evaluation, bounded execution, three-valued logic, aggregation, the streaming lane.
  8. Results and Language Boundaries — the result model, the C ABI, zero-copy Arrow export.
  9. Testing and Measurement — the TCK, the crash harness, the benchmark ledger.
  10. Case Studies in Measured Trade-offs — the measurements that made (and unmade) design decisions.