SurrealDB

A scalable, distributed document-graph database for the realtime web, usable embedded or as a client from Rust.

Library
Cargo
v3.3.0-beta.2
32,904stars
BSL-1.1

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
90/100Excellent
Development Activity100
Maintenance100
Community64
Maturity56
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture92
Code Quality86
Innovation90
Learning Curve62

SurrealDB is a scalable, distributed, collaborative document-graph database designed for the realtime web. The surrealdb Rust crate is the official way to use it from Rust: you can embed the database engine directly in your application (in-memory or on-disk) or connect to a remote SurrealDB server over WebSocket or HTTP with the same API.

It combines document, graph, and relational models behind SurrealQL, a SQL-like query language, and supports realtime live queries, authentication, and schema-flexible data. The crate exposes a strongly typed async Rust API for querying, mutating, and subscribing to data.

What You Get

  • An embeddable database engine (in-memory or on-disk) plus a remote client, sharing one Rust API
  • SurrealQL — a SQL-like language spanning document, graph, and relational models
  • Realtime live queries that stream changes as data is updated
  • A strongly typed async API for querying, mutating, authentication, and subscriptions

Common Use Cases

  • Embedding a flexible database directly inside a Rust application or CLI
  • Building realtime apps that subscribe to live query updates
  • Modeling connected/graph data alongside documents without a separate graph store

Under The Hood

Architecture — SurrealDB is a large Cargo workspace. The published surrealdb crate is the public entry point, layering over internal crates: core (the database engine), parser/ast/token (SurrealQL parsing), types, common, and server (the standalone server binary), plus an mcp crate. The client abstracts storage engines behind a connection string, so memory, rocksdb, or a remote ws/http endpoint present the same async API; queries are compiled by the SurrealQL parser and executed against the selected engine.

Tech Stack — Rust (edition 2024), async throughout, distributed as a multi-crate workspace. It bundles storage backends and a full query engine rather than depending on an external database.

Code Quality — A very actively maintained, mature codebase (health 88) with strong CI and clear crate boundaries separating parsing, engine, types, and server concerns. The workspace layout keeps the substantial engine independently testable from the client surface.

API Design — The async Rust API is ergonomic: a single Surreal client, a fluent query/select/create surface with serde-based typing, and live-query subscriptions. The main learning cost is SurrealQL itself and its multi-model concepts, not the Rust binding, which stays idiomatic.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search