A Rust property-graph engine exploring consistent, bounded distributed queries.
VelaGraph combines a RocksDB graph kernel, standard Gremlin syntax, Raft-backed storage nodes and cross-shard query coordination. The goal is a general-purpose distributed graph system for changing, relationship-rich data, not an engine specialized for one dataset.
Experimental, not production-ready. Several APIs deliberately have different consistency and capacity contracts. Choose the path below before building on it. Network services are unauthenticated plaintext development endpoints; the public HTTP/gRPC preview defaults to loopback; HTTP has an explicit trusted-network opt-in. Neither is production-ready.
Quick start · Capabilities · Architecture · Roadmap · Contribute
- Graph-first storage: typed vertex/edge properties, adjacency indexes and deterministic record encoding on RocksDB. The legacy SQL engine is removed.
- Standard language, explicit boundaries: an officially parsed Gremlin subset; unsupported steps and exhausted query budgets fail explicitly rather than silently producing partial success.
- Consistent reads while data changes: the restricted managed path coordinates typed mutations and pins a certified version for a query. The experimental observed path has a different, weaker contract.
- Evidence-driven development: independent-process tests, recovery checks and a CoreHR fixture with 200,000 people and 5,000 departments. CoreHR exercises generic hierarchy and membership queries; it does not introduce HR-specific execution rules.
Internal graph, managed, coordinator and Raft transports use typed gRPC. See graph library migration for completed legacy-listener retirement, explicit-identity API changes and validation boundaries. Public HTTP remains supported; old JSON/TCP clients are not a supported fallback.
Go clients can build a managed traversal locally and submit its steps in one
typed GraphService.Execute gRPC call without sending Gremlin text for parsing.
This is not a server-side prepared-plan handle or reuse of the local Rust
prepared-query API. See the Go client SDK for supported steps
and snapshot selection.
Go applications can also embed the local engine through the optional
sdk/go/native cgo package and versioned C ABI. It supports
ordinary memory graphs, temporal RocksDB, prepared queries and controlled batches
without a server. Packed results support owned Go objects or explicitly closed
views with zero-copy result access. Its Go package includes the ABI header for
module/vendor consumers; the matching native library is supplied separately.
This path has local consistency and shared-process failure
semantics; enable it explicitly with velagraph_native and a matching native library.
v0.0.1 is a published
source-only experimental prerelease, not a prebuilt binary or production release.
This README describes development main, which includes later changes. For the
released scope and limitations, use the tagged source and its release notes; keep
clients and services on the same source version.
Requires a current stable Rust toolchain and the native RocksDB build dependencies (C++ compiler and Clang/libclang). See setup if they are not installed. The first build compiles RocksDB and needs time and several GiB of disk; this is a source build, not a prebuilt download.
git clone https://github.com/ashione/VelaGraph.git
cd VelaGraph
cargo run --locked -p velagraph --example quickstartCreated: Ada --KNOWS--> Grace
Query: g.V(1).out('KNOWS').values('name')
Result: Grace
Temporary graph removed. No server was started.
This small executable example creates two vertices and one edge, executes standard Gremlin and removes its temporary database on normal completion. It opens no ports and can be run repeatedly. Forced process termination may leave a temporary directory. This is the local kernel, not a distributed consistency demonstration.
Next: run the three-process distributed demo for cross-shard observed queries, or read CONTRIBUTING for development and tests. The distributed demo uses plaintext loopback, single-voter groups and explicit Unverified completeness; it does not establish node-loss tolerance.
For a plaintext loopback demo with three independent nodes and a public HTTP/gRPC service, use a directory that does not already exist:
bash scripts/managed-service-demo.sh /tmp/velagraph-first-demoThe script builds the source and prints the actual HTTP/gRPC addresses. Ctrl-C stops the processes; data is retained, but this fresh-only demo refuses to reuse or restore that directory. See write/query examples and limits and the design. Single-voter groups are not HA, and these unauthenticated listeners must stay on loopback.
The graph-service guide documents the default-loopback
HTTP/gRPC preview, configuration and exact launch command. It requires existing
activated managed nodes and their gRPC endpoints; it is not a one-command cluster
bootstrap or restore workflow. HTTP /preview1 is not the final protobuf JSON
contract. See the guide's readiness and lifecycle limits before exposing a client.
The Rust package and import name are both velagraph. The local
GraphEngine API supports vertices, edges, bounded Gremlin, snapshot views and
explicit single-partition transactions. It is not itself a distributed client.
See query semantics, transactions
and the executable graph tests / Gremlin tests.
For vertex and edge CRUD on a Raft shard, construct a
storage-backed graph engine
with GraphEngine::from_storage_node(adapter, shard, partition).
The local, in-process Raft and directly addressed remote storage adapters support
write-only single-shard transactions.
This API carries a caller-supplied request ID if the commit outcome is unknown.
RouteResolver::begin_v1 selects one shard by catalog partition. Older remote
peers return Unsupported at begin.
Local temporal queries support reusable parsed plans, typed bindings and bounded query reuse. For repeated local reads at a fixed version, materialized temporal reads trade explicit construction and memory costs for in-memory queries. These models do not refresh themselves. See performance evidence for reproduction and scope.
Existing callers migrating from rocksdb_sql_table should read the
SQL removal and crate-rename note. RocksDB remains the
storage engine; removing SQL did not remove it.
IncrementalGraph is an experimental local read-model backend for ordinary
vertices and edges. It stages bounded changes and publishes records, bidirectional
indexes, a local sequence and opaque caller progress atomically. Locked readers
retain a read lock; COW readers retain an immutable version while updates copy
only touched index shards and adjacency chunks. Gremlin uses the existing executor.
This API does not replace GraphEngine, temporal assertions or managed storage.
Memory commits are not individually durable. A separate versioned local checkpoint
supports model recovery, but the caller still owns source identity, replayability,
reader lifetimes and aggregate memory policy. See the design and limits.
cargo run --release --locked -p velagraph --example incremental_memory
cargo run --release --locked -p velagraph --example incremental_publicationCOW prepares changed index shards outside the reader publication lock and releases
retired data after unlocking. Its version budget includes the candidate construction
peak. Checkpoint publication prevents older or conflicting snapshots from replacing
an existing target and coordinates through a persistent directory lock sidecar.
The incremental_publication example measures version acquisition during writes.
The incremental_memory example uses generated data, compares rebuilding with incremental publication,
checks each version and restores a checkpoint before continuing. Its timings are
local observations, not a disk-durability comparison or service capacity claim.
Support in one row does not imply support in the others.
| Path | What works now | Important boundary |
|---|---|---|
| Local v1 / K3 | Property graph CRUD, bounded Gremlin, snapshot views and single-partition transactions. A separate D1 graph-record adapter connects v1 to Raft. | Local edges stay in one partition. Explicit K3 commits sync their batch; local autocommit writes retain their older no-per-write-fsync behavior. |
| Observed cross-shard experiment | Static remote routing, server-side traversal, bounded hierarchy jobs, global vertex scan composition and selected result/property pages. | Staged writes are not atomic across shards. Reads retain per-shard snapshots and Unverified completeness, not one certified graph version. |
| Managed fixed cohort | Coordinated typed creates, property changes, edge deletion/replacement, durable request identity and same-version queries; optional data-local parallel execution and renewable query jobs. | Requires explicit activation from an empty baseline and fixed membership. No general transaction programs, vertex-delete/cascade API, dynamic placement or arbitrary imported-baseline certification. |
Managed sessions keep one certified V, including across result pages and
concurrent writes. They do not make arbitrary low-level writes safe or prove
adjacency completeness. The older observed GlobalCommittedSnapshot option
still rejects unsupported requests; it is not silently upgraded to managed reads.
For exact supported steps and entrypoints, start with:
- Local query contract
- Observed distributed queries and hierarchy result pages
- Managed graph gateway, fixed-version traversals and data-local gateway
- Renewable query jobs and fixed-cohort membership
The data-local managed executor supports 1–8 shard lanes (default 3), independent of the fixed cohort's 64-member structural bound. These are configuration bounds, not evidence of 64-node performance. Query capture, rows, work, leases and admission each have separate limits. The opt-in 8 MiB query capture profile is not a graph-size or process-memory ceiling and does not expand query jobs.
Both managed capacity profiles retain a 16 MiB history budget. Active checkpoints do not reclaim historical capacity; cold replay and complete snapshots still do history-sized work. There is no history GC or unlimited write lifetime. See capacity profiles and the current capability index for the full boundaries.
Standard Gremlin / typed graph mutations
|
Local kernel | Remote routing / query coordinator
| |
| Raft-backed storage nodes
| |
+------ RocksDB records and adjacency
| Source | Responsibility |
|---|---|
src/graph.rs, src/graph_records.rs |
Local transactions and D1-backed graph records |
src/gremlin.rs |
Official-parser query planning/execution |
crates/d2-raft/ |
Durable storage-node and consensus foundations |
crates/replicated-graph/ |
Routing, observed/managed APIs, query coordination and CLI |
crates/checkpoint-object-store/ |
Experimental immutable checkpoint transport |
scripts/, docs/ |
Reproducible scenarios, contracts and evidence |
The typed gRPC graph endpoint
provides Open / Page / Close over a reusable HTTP/2 channel. It retains the existing snapshot/session budgets without starting a legacy TCP listener. The same endpoint hosts the separate
typed observed query-fragment service, used by
graph-coordinator serve by default. A separate
typed fixed-version session service is selected
by the managed gateway's explicit gRPC graph-route constructor.
The default storage adapter uses a bounded Metadata RPC stream
for each read freshness check, while Probe/Write remain unary and snapshots remain
paged. It caches transport, never epoch results; explicit stream/connection budgets
and slow-reader availability limits still apply.
Typed managed control/write RPC adds explicit
coordinator/member gRPC clients and listeners; graph-service now always uses
these plus gRPC graph routes without a transport switch or fallback. It opens only
the configured public HTTP/gRPC listeners, not an unused legacy gateway port. Observed
hierarchy shard jobs and Raft peers also have typed gRPC paths.
Observed coordinator query/job ingress now has a typed gRPC service: use
graph-coordinator serve and unflagged query/hierarchy client commands. The old
serve-grpc command and --grpc flag are rejected. The observed coordinator library now also uses typed RPC, including explicit
consistency negotiation. GraphService library listeners now also use typed gRPC;
process-node driver/control now uses typed gRPC too;
these internal observed endpoints are not the public managed API.
Single-shard Probe/Metadata/Write also have an explicit typed RPC service and CLI. Catalog/routing adapters now use typed snapshots/operations by default; graph-node --graph is a single typed listener and --grpc-snapshot is removed. The old Linux UDS read gateway is retired. Retired-protocol fixtures test rejection only; no supported graph library API selects a legacy listener. This does not complete cross-language interoperability, HTTP feature parity, upgrade compatibility or production-readiness gates in #218.
Local RocksDB/Raft remains the durable authority. The object-store library can upload/download immutable physical checkpoints and validates content hashes; the read-only verification CLI checks a retained receipt without staging a local backup. S3-compatible transport is tested against SeaweedFS. This is backup transport, not object-store-authoritative storage, remote-durable write acknowledgement or live-cluster recovery. Offline recovery can restore the D2 coordinator and every fixed-cohort member from a selected local generation or an object-store receipt, then verify the copied decision history and inspect managed vertices and edges at the requested version. See the physical checkpoint and object-store API contracts.
The roadmap and linked GitHub issues track acceptance criteria, not promises that an experimental slice is a finished database. Major remaining work includes:
- Broader generic distributed queries, scalable history/retention and verified managed reads at full CoreHR scale.
- Recovery, failover, placement and migration. A global checkpoint must restore one coherent graph version before making that recovered view queryable; independent physical backups alone do not establish this.
- Bitemporal graph semantics: valid time and system version. An in-memory reference and durable local temporal slice are implemented. The latter uses a separate RocksDB database and synced local versions; it is connected to bounded official-Gremlin explicit-ID point queries and indexed out/in/both traversal, not global scans, managed/cohort V or existing checkpoints. A separate managed vertex assertion slice stores temporal vertices in existing member state machines and reads at fixed V/T; it does not add temporal edges, a public temporal service or global recovery.
- Object-store-authoritative storage with disposable local caches, subject to durability and recovery design; native S3/OSS/TOS deployment validation remains separate from the current checkpoint transport.
- Production security and, later, operational observability and visualization.
External contributors are welcome. Useful contributions include bug reproductions, documentation, query conformance tests, generic performance work and implementation of scoped roadmap items. Start with CONTRIBUTING.md for setup, checks and the issue/PR workflow.
Ordinary CI runs formatting, tests and Clippy.
CoreHR CI separately exercises the full observed scenario and
event-specific managed lifecycle/recovery: PRs use a short recovery check; main
pushes, scheduled and manual runs retain the full 1,025-write acceptance. A green
PR lifecycle gate is not full 1,025-write acceptance. Object-store tests have their
own workflow.
cargo test --locked does not run every ignored long test or every workspace
member. Passing same-host tests is not proof of multi-machine performance or HA.
See performance evidence and external benchmark plans.
Results apply to their named source, binaries and workload, not every subsequent commit.
Project-authored code and documentation default to Apache-2.0, except
where a file or component declares otherwise. The three existing workspace
crates retain MIT OR Apache-2.0; third-party licenses and notices are preserved.
See licensing details and the
OpenRaft notice. This is not a claim of a completed
historical provenance audit or a complete dependency-attribution bundle.