graphersal
An in-memory graph database and traversal engine in Rust, queried with Gremlin, the query language of Apache TinkerPop.
Playground · Book · Step reference · Repository

[]
= { = "0.1", = ["script", "io", "display"] }
use Arc;
use *;
What is in it
- A property graph in memory: vertices with a set of labels, edges, properties of logical types
(
int64,float64,string,uuid, arrays, objects), indexes and graph statistics. - The Gremlin steps as a Rust API and as text, the Gremlin DSL (on Rhai), with
a rule-based optimizer, bulk traversers and
profile()/execute()showing the optimized plan with timings, counts and memory per step. - Every traversal is atomic: it commits completely or is rolled back. Explicit transactions, dry runs and change capture with commit hooks for everything around it.
- Schemas in a subset of JSON Schema 2020-12, enforced on write in
openorclosedmode, inferred from data, patched, validated and diffed. - Running queries you did not write: resource limits, timeouts, cancellation, a memory budget and
permissions (an
Authorizer, for example the ready-madeAccessPolicy::read_only()). - Saved queries: named, parameterized queries stored in the graph.
- Persistence: lossless snapshots, a write-ahead journal, and the Store (one directory or one file = one graph) with point-in-time views, fork, rollback, verified backups and repair; the format is a public specification.
- Your own storage: the whole engine is generic over the
GraphStoragetrait (EXPERIMENTAL in 0.1.x), with the conformance suitegraphersal-storage-tests.
Features
All off by default and strictly additive:
| Feature | What it adds |
|---|---|
script |
the Gremlin DSL as text, with safe default limits |
io |
GraphSON 3.0 and GraphML import and export |
display |
results rendered as tables |
serde |
serialization of change sets and schemas, the JSON visualizer |
persist |
snapshots, the journal and the Store; persist-zstd and persist-zip add zstd chunks and ZIP backups |
alloc-tracking |
exact per-step memory figures in profile() (the binary installs the allocator) |
Learn more
- Rust Quick Start and the API documentation.
- The command line tool, REPL, dev server and MCP endpoint: the
graphersal-clicrate (binarygraphersal). - Apache TinkerPop's own test suite runs on every test run: more than 95 % of the scenarios in scope pass, and no implemented step gives a wrong result (compliance, deviations).
Graphersal is compatible with, and inspired by, Apache TinkerPop Gremlin. It is an independent project: it is not part of Apache TinkerPop and is not endorsed by the Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE and NOTICE).