Cypher graphs, from a unit test to bigger than RAM.

A graph database in Rust for developers who want Cypher inside their application: embed it as a library, or run the server and connect with the Neo4j drivers you already use.

Run it with the movies graph

$ docker run --rm -p 127.0.0.1:7475:7475 -p 127.0.0.1:7687:7687 ghcr.io/janvencl/graphbuff --demo movies

Needs Docker. Try it in your browser · Other ways to install

MATCH (k:Person {name: 'Keanu Reeves'})-[:ACTED_IN]->(m)<-[:ACTED_IN]-(co)
RETURN co.name, count(m) AS movies
ACTED_INACTED_INDIRECTEDThe MatrixMatrix ReloadedJohn WickKeanu ReevesCarrie-Anne MossHugo WeavingLana Wachowski
co.namemovies
"Carrie-Anne Moss"2
"Hugo Weaving"1

21ms

Breadth-first search over 13 million relationships. On a gaming GPU.

Build with the gpu feature and GraphBuff moves its graph kernels onto any GPU with Vulkan, Direct3D 12 or Metal. No CUDA, no vendor lock-in, no separate analytics cluster. The planner decides per query, and the answers are the CPU's answers, down to the bit for PageRank.

  • 24× faster BFS
  • 9.5× faster multi-hop walk counts
  • 5× faster Cypher count(*)
  • 0 changes to your queries
Hardware, commit and command for every number How the GPU backend works
Breadth-first search510 ms21 ms24×
Three-hop walk counts180 ms19 ms9.5×
Cypher two-hop count(*)154 ms31 ms5.0×
PageRank, 20 iterations1,293 ms557 ms2.3×

13 million relationships. Each row scaled to its own CPU time. Reproduce with cargo run --release -p graphbuff --features gpu --example gpubench.

Connect with the drivers you already use.

The server speaks Bolt 4.4 and 5.0 to 5.4, the protocol of the official Neo4j drivers. Smoke-tested with the Python and Java drivers. Prefer plain HTTP? Every query is one JSON POST.

  • Neo4j drivers
  • Python
  • Java
  • Rust
from neo4j import GraphDatabase

driver = GraphDatabase.driver(
    "bolt://127.0.0.1:7687", auth=("neo4j", "s3cret"))
records, summary, keys = driver.execute_query(
    "MATCH (p:Person) RETURN p.name AS name")

Open source, with transactions, access control, TLS and backups in the box.

Open source
Free and open source under the GNU AGPL v3. Use it commercially. Project status
Snapshot reads
Readers never wait for writers. Each query sees one committed state, in every storage mode. Concurrency
Roles
reader, editor and admin, checked on every statement. PBKDF2 password hashes. Security
TLS 1.3
HTTPS and Bolt over TLS on the same ports, through rustls. Users and TLS
Online backup
Back up while queries keep committing. Restore and consistency checks from the CLI or over HTTP. Backup
Bulk import
1 million relationships from CSV in about 9 seconds, in the neo4j-admin import format. Benchmark
All features

Two commands to a running graph.

$ docker run --rm -p 127.0.0.1:7475:7475 -p 127.0.0.1:7687:7687 ghcr.io/janvencl/graphbuff --demo movies

Needs Docker. Full walkthrough