What SurrealDB Does
- Multi-model — document, graph, relational, time-series in one DB
- SurrealQL — SQL-like with graph traversal, record links, subqueries
- Graph relations — RELATE for typed edges between records
- Record links — embed references between documents
- Live queries — real-time change notifications
- Full-text search — BM25 index built in
- Permissions — row-level security with JWT auth
- Multi-tenancy — namespace and database isolation
- Embedded or server — use as library or HTTP/WebSocket server
- SDK — JavaScript, Python, Rust, Go, Java, .NET, PHP
Architecture
Rust binary with multiple storage backends: in-memory, RocksDB (single node), TiKV (distributed), FoundationDB (distributed). HTTP and WebSocket API for clients. SurrealQL parser compiles queries to execution plans.
Self-Hosting
# Single-node with persistence
surreal start --log info --user root --pass root file://surreal.db
# Distributed (TiKV backend)
surreal start --log info --user root --pass root tikv://pd:2379Key Features
- Multi-model (doc + graph + relational)
- SurrealQL query language
- Graph traversal
- Live queries (real-time)
- Full-text search (BM25)
- Row-level permissions
- Multi-tenancy
- Embedded or server mode
- Multiple storage backends
- SDKs for 7+ languages
Comparison
| Database | Models | Query Lang | Distributed |
|---|---|---|---|
| SurrealDB | Doc + Graph + Relational | SurrealQL | Via TiKV/FDB |
| MongoDB | Document | MQL | Sharding |
| Neo4j | Graph | Cypher | Enterprise |
| PostgreSQL | Relational (+ JSON) | SQL | Logical repl |
| ArangoDB | Doc + Graph + KV | AQL | Native |
| FaunaDB | Document + relational | FQL | Managed |
FAQ
Q: One database for everything? A: SurrealDB aims to reduce polyglot persistence complexity. Documents, graph relationships, and full-text search live in one engine, no need to sync multiple databases. Fits medium-scale projects.
Q: Is it production ready? A: v2.0+ is significantly more stable, but the ecosystem is young compared to PostgreSQL/MongoDB. Suitable for new and innovative applications; mission-critical systems need evaluation.
Q: BSL restrictions? A: Self-use and embedding in applications are completely fine. You can't run a managed SurrealDB service competing with the official one. Auto-converts to Apache 2.0 after 4 years.
Sources
- Docs: https://surrealdb.com/docs
- GitHub: https://github.com/surrealdb/surrealdb
- License: BSL 1.1