High-performance embeddable graph database with Cypher queries, ACID transactions, Raft replication, and 50 GB+ scale — all in a single dependency-free binary.
Features
From sub-millisecond lookups to distributed replication — GoraphDB packs enterprise-grade features into a single Go binary.
Sub-millisecond indexed lookups with B+tree secondary indexes, composite indexes, and LIMIT push-down optimization.
Full read/write Cypher support with MATCH, CREATE, MERGE, SET, DELETE, OPTIONAL MATCH, parameterized queries, and EXPLAIN/PROFILE.
Begin/Commit/Rollback API for multi-statement atomic operations with read-your-writes semantics and CRC32 data integrity.
Single-leader replication with automatic failover via Raft consensus. WAL-based log shipping over gRPC with transparent write forwarding.
Built-in BFS, DFS, Shortest Path (Dijkstra), All Paths, Connected Components, and Topological Sort with concurrent execution.
Transparent hash-based partitioning across multiple bbolt files. Edges co-located with source nodes for single-shard traversals.
Built-in atomic counters with Prometheus text exposition. Track queries, cache hits, node/edge CRUD, index lookups, and live gauges.
CypherStream() returns a lazy RowIterator for O(1) memory. NDJSON streaming via POST /api/cypher/stream for large result sets.
Enforce value uniqueness across labeled nodes with O(1) lookup. WAL-replicated, enforced on all write paths including Cypher MERGE.
bbolt memory-mapped storage with configurable MmapSize. Byte-budgeted sharded LRU cache (128 MB default) for predictable memory.
Fully parallel BFS, DFS, Cypher, and query-builder calls via MVCC snapshot isolation. Built-in goroutine worker pool.
MaxResultRows cap, DefaultQueryTimeout, slow query log, prepared statement cache (10K entries), and panic recovery on all entry points.
Interactive Demo
Explore graph data with Cypher queries. Click nodes to navigate, run queries to see relationships unfold.
MATCH (a {name: "Alice"})-[:FOLLOWS]->(b)
RETURN b.namePerformance
Benchmarked on Apple M-series. Sub-millisecond indexed lookups, batch inserts in 120ms, and a query cache that makes repeated queries near-instant.
Architecture
From the UI layer down to the storage engine — every layer is designed for performance and simplicity.
React + TypeScript + Tailwind · cytoscape.js · CodeMirror
/api/cypher · /api/nodes · /api/edges · /api/indexes · /api/health
WAL · gRPC Log Shipping · Applier · Raft Election
Lexer → Parser → AST → Executor (index-aware)
bbolt (B+tree) · Memory-mapped · MVCC · MessagePack
Get Started
Go from zero to graph queries in minutes. A clean, fluent API that feels native to Go.
package main
import (
"fmt"
"context"
graphdb "github.com/mstrYoda/goraphdb"
)
func main() {
db, _ := graphdb.Open("./my.db", graphdb.DefaultOptions())
defer db.Close()
alice, _ := db.AddNode(graphdb.Props{"name": "Alice", "age": 30})
bob, _ := db.AddNode(graphdb.Props{"name": "Bob", "age": 25})
db.AddEdge(alice, bob, "follows", graphdb.Props{"since": "2024"})
ctx := context.Background()
res, _ := db.Cypher(ctx, `MATCH (a {name: "Alice"})-[:follows]->(b)
RETURN b.name`)
for _, row := range res.Rows {
fmt.Println(row["b.name"]) // Bob
}
}Get started in under 5 minutes. One Go module, zero external dependencies, instant graph power.