Features
- Multi-model: document, graph, relational in one database
- SurrealQL query language with graph traversal
- Built-in auth, permissions, and real-time subscriptions
- Embeddable or client-server deployment
Pros
- Single database handles multiple data models
- Built-in authentication eliminates backend boilerplate
- Can replace backend + database for simple apps
Cons
- Still maturing — not yet battle-tested at large scale
- Unique query language has a learning curve
- Smaller ecosystem and community
Overview
SurrealDB is a multi-model database written in Rust that combines document, graph, and relational data models into a single platform. Its query language, SurrealQL, extends SQL with graph traversal, record links, and embedded objects, allowing you to model complex relationships naturally.
SurrealDB includes built-in authentication, row-level permissions, real-time WebSocket subscriptions, and can be embedded directly into applications. This makes it possible to connect directly from the frontend without a traditional backend server for simpler applications.
When to Use
SurrealDB is interesting for projects that need multiple data models (documents and graphs), when you want built-in auth and real-time without a separate backend, or for prototyping where its all-in-one approach accelerates development. For production-critical applications, PostgreSQL remains the safer choice.
Getting Started
# Install and start
curl -sSf https://install.surrealdb.com | sh
surreal start --user root --pass root
# Connect
surreal sql --conn http://localhost:8000 --user root --pass root
CREATE user:alice SET name = 'Alice', email = 'alice@example.com';
SELECT * FROM user WHERE name = 'Alice';