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: 一个数据库解决所有问题? A: SurrealDB 的目标是减少 polyglot persistence 的复杂度。文档、图关系、全文搜索在一个引擎里,不用同步多个数据库。适合中等规模项目。
Q: 生产就绪了吗? A: v2.0+ 已经大幅稳定,但相比 PostgreSQL/MongoDB 生态还年轻。适合新项目和创新应用,关键任务系统需要评估。
Q: BSL 限制? A: 自用、嵌入应用完全 OK。不能做托管 SurrealDB 服务与官方竞争。4 年后自动转 Apache 2.0。
来源与致谢 Sources
- Docs: https://surrealdb.com/docs
- GitHub: https://github.com/surrealdb/surrealdb
- License: BSL 1.1