SurrealDB
SurrealDB: A Unified, Multi-Model Database Built in Rust

SurrealDB is more than a database. It’s a single, Rust-powered engine designed to unify multiple data models under one roof. By combining document, graph, relational, time-series, geospatial, and retrieval data types with powerful search (full-text, vector, and hybrid) and real-time capabilities, SurrealDB aims to simplify building modern, data-driven applications. It’s engineered to run as an embedded library, in the browser via WebAssembly, at the edge, or as a distributed cloud service. In short, SurrealDB is designed to slot into your architecture as a versatile backbone that reduces complexity, accelerates development, and scales gracefully.
What makes SurrealDB compelling
SurrealDB’s core promise is to offer a single, coherent data platform that handles many data patterns and workloads without forcing developers to bolt together multiple systems or write a lot of custom middleware. Here are the pillars that define its value proposition.
Unified data models, native multi-model engine
Documents, tables, graphs, time-series, and geospatial data sit side by side in one engine.
Retrieval capabilities (full-text, vector, and hybrid) are integrated for fast, flexible search and analytics.
A single query paradigm—SurrealQL—covers diverse access patterns without the need to switch between technologies.
Real-time collaboration and API-first design
SurrealDB doubles as both a database and an API backend, enabling real-time collaboration out of the box.
WebSocket-based connections support bi-directional queries, responses, and event-driven notifications.
Flexible querying with multiple languages
SurrealQL provides a SQL-like, intuitive surface for most common tasks.
Client devices can run SQL-style queries, while GraphQL, REST CRUD, and JSON-RPC pathways are supported or planned.
Fine-grained access control
Row- and column-level permissions give precise control over who can read or modify data.
Permissions rules can be expressed in a straightforward, schema-defined manner, reducing the need for extra backend code.
Simple schema, powerful defaults
Schema can be defined in a way that’s friendly to frontend and backend development.
Once a schema is declared, appropriate access is automatically granted, streamlining development.
Embedded by design, scalable by intention
Built as a single library in Rust, SurrealDB can run embedded in your app or as a distributed cluster in the cloud.
The system is designed to be lightweight enough for edge deployments yet robust enough for high-availability, multi-node environments.
JavaScript extensions and custom logic
You can embed JavaScript functions directly in the data layer, enabling complex computations to occur where the data resides.
ES2020-compatible features empower developers to implement sophisticated logic without moving data across the network.
Strong ecosystem and open collaboration
A vibrant community supports SurrealDB with documentation, tutorials, and development discussions.
Community channels include blogs, forums, Discord, YouTube, and social feeds to share knowledge and use-cases.
A tour of features (highlights)
Multi-model data storage
Use tables for structured data (with optional schema), documents for flexible data shapes, and graph constructs for related entities and directed connections.
Inter-document relations are performed natively via graph edges, enabling efficient, richly connected queries.
ACID transactions and consistency
SurrealDB supports multi-row, multi-table ACID transactions, ensuring consistency across writes.
Real-time and live queries
Live queries push updates to clients as data changes, making it suitable for dashboards, collaborative apps, and streaming-like use cases.
Geospatial and time-series capabilities
Store GeoJSON-like data types (points, lines, polygons) and perform geospatial queries.
Time-series data can be modeled, queried, and analyzed with built-in capabilities.
Client- and browser-first connectivity
Direct connections from web browsers and client devices are supported, with robust access controls and secure channels.
JavaScript extendability
Write custom, in-database logic using embedded JavaScript functions, leveraging modern language features.
Edge, embedded, and cloud deployment
A single Rust binary can run embedded in your application, on the edge, or as a distributed cloud service, with low memory and CPU overhead designed for broad environments.
Getting started: how to begin with SurrealDB
Getting started is designed to be straightforward: launch the SurrealDB server, pick your platform, and connect via the appropriate SDK. The ecosystem includes a rich set of client libraries and tooling to accelerate your first steps.
Client and server setup
SurrealDB is deployable in multiple modes: as a standalone server, embedded library, or via containers.
The same binary can serve as the data store and the API backend, simplifying deployment.
Language-specific integrations
The platform ships with client libraries and SDKs for Rust, JavaScript, WebAssembly, Node.js, Deno, Python, Go, .NET, PHP, and Java.
Sample icons and starter integrations help you wire SurrealDB into your stack quickly.
Documentation and learning resources
Official documentation provides installation, development, deployment, and administration guidance.
SurrealDB University and the interactive Surreal Renaissance (an exploratory “book”) help you learn by doing.
Quick-start tips
If you’re on macOS, the recommended path is Homebrew-based installation, which brings the CLI and server in a single package.
For Linux, a quick curl-based installer script sets up the SurrealDB CLI and server with guided prompts.
Docker offers a portable route to run SurrealDB in containers with a simple command, ideal for development and testing.
What you can run on day one
Quick examples to illustrate SurrealQL
Update and compute fields on the fly, leveraging dynamic expressions.
Define and enforce field types and constraints, with the option to opt into schema-full or schema-less modes.
Create and manage unique indexes, events, and triggers right within the data model.
Model relationships using graph edges and graph queries, enabling multi-depth traversals without traditional JOINs.
Sample SurrealQL snippets to get you started
You can perform updates with computed values:
- UPDATE person SET waist = "34", height = 201, score = 0.3 + 0.3 + 0.3 + 0.1 ;
Define computed fields that are calculated when retrieved:
- DEFINE FIELD can_drive ON TABLE person COMPUTED time::now() > birthday + 18y;
Create structured data with a schema-full table:
- DEFINE TABLE user SCHEMAFULL;
- DEFINE FIELD name ON TABLE user TYPE object;
Establish unique indexes and events:
- DEFINE INDEX email ON TABLE user COLUMNS email UNIQUE;
- DEFINE EVENT email ON TABLE user WHEN $before.email != $after.email THEN ( CREATE event SET user = $value, time = time::now(), value = $after.email, action = 'email_changed' );
Build directed graphs with edges:
- RELATE user:tobie->write->article:surreal SET time.written = time::now();
Perform nuanced queries across nested structures:
- SELECT emails[WHERE active = true] FROM person;
Leverage geospatial types:
- UPDATE city:london SET centre = (-0.118092, 51.509865), boundary = { type: "Polygon", coordinates: [ [ [-0.38314819, 51.37692386], [0.1785278, 51.37692386], [0.1785278, 51.61460570], [-0.38314819, 51.61460570], [-0.38314819, 51.37692386] ] ] };
Extend logic with JavaScript:
- CREATE film SET ratings = [ { rating: 6, user: user:bt8e39uh1ouhfm8ko8s0 }, { rating: 8, user: user:bsilfhu88j04rgs0ga70 } ], featured = function() { return this.ratings.filter(r => { return r.rating >= 7; }).map(r => { return { …r, rating: r.rating * 10 }; }); } ;
A closer look at why SurrealDB is different
Database, API, and permissions fused
SurrealDB merges the database layer, the querying layer, and the API/authentication surface into one cohesive platform.
Its permissions model supports granular access control, enabling precise data exposure without writing bespoke backend code or complex security rules.
Tables, documents, and graph in one place
The multi-model approach lets you store and query data in the most natural format for your application, without committing to a single model.
Inter-document relationships are modeled with edges, providing a straightforward path to graph-like queries without the performance penalties of traditional JOINs.
Advanced inter-document relations and analysis
Full graph database capabilities enable multi-table and multi-depth retrieval with on-database processing.
The system intelligently handles complex queries and reduces data movement between the client and server.
Simple schema definition and client-friendly access
A single schema declaration drives access permissions and data rules, reducing the need for separate API layers.
This approach speeds up development and minimizes the risk of mismatched security policies.
Browser-ready connectivity and real-time capabilities
Developers can connect directly from web browsers and client devices, maintaining strong security and fast data delivery.
Realtime updates and live queries enable responsive, dynamic interfaces with minimal latency.
Flexible query tools
SurrealQL is the primary language, with continued expansion toward GraphQL compatibility, REST CRUD, and JSON-RPC for diverse client needs.
The design favors a query-first workflow that remains approachable for frontend developers while packing powerful backend capabilities.
Extendability through JavaScript
In-database JavaScript functions enable sophisticated data processing close to where data resides, reducing round-trips and bandwidth usage.
Built for embedded and cloud
Rust-based, SurrealDB is optimized for both embedded usage and distributed, cloud-native deployments.
The architecture supports scalable clusters and provides resilience through distributed transaction handling.
Community, security, and licensing
A strong community ecosystem supports learning, troubleshooting, and collaboration.
Security policies and vulnerability channels are in place to help maintain a robust, trustworthy platform.
Licenses are diversified across repositories, with core components released under Business Source License 1.1 for the core SurrealDB project, and other components under permissive licenses.
A look at the ecosystem and resources
Documentation and learning
Official docs cover installation, development, deployment, and administration.
Tutorials and university-style content help developers master SurrealDB concepts quickly.
Cloud and self-hosted options
SurrealDB Cloud offers a managed experience for teams that want to focus on product development rather than infrastructure.
For those who prefer self-hosted setups, SurrealDB provides simple installation paths and containerized deployment options.
Community and contributing
The project invites contributors to participate via the contributing guide and release process documentation.
Community nodes beyond GitHub include blogs, social feeds, Discord chat, YouTube channels, and developer forums.
Security and licensing
A vulnerability policy and security page direct researchers and practitioners to responsible avenues for disclosure.
Licensing varies by repository, reflecting the modular nature of SurrealDB’s ecosystem.
A quick guide to installation options (recap)
macOS
Quick-start path: Homebrew provides a single-package install for the CLI and server.
Example: brew install surrealdb/tap/surreal
For the latest nightly features: brew install surrealdb/tap/surreal-nightly
Linux
One-liner installer: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh
Beta and nightly variants are also available with additional flags.
Windows
PowerShell-based installer: iwr https://windows.surrealdb.com -useb | iex
Nightly variant: iex "& { $(irm https://windows.surrealdb.com) } -Nightly"
Docker
Run a development server quickly, or initialize with authentication and logging.
Example: docker run --rm --pull always --name surrealdb -p 8000:8000 surrealdb/surrealdb:latest start
Quick look and use in production
The quick-look examples demonstrate direct-to-client querying, real-time data synchronization, and powerful data modeling capabilities.
Connecting SurrealDB to your apps
Frontend and mobile apps
Direct browser connections enable rich, secure experiences with minimal server-side glue.
WebSocket connectivity makes real-time data updates naturally fit into modern UIs.
Backend services and microservices
Server-side code can leverage SurrealDB’s built-in permissions and ACID transactions to implement robust services without bespoke backends.
AI and knowledge graphs
The multi-model approach is well-suited to AI agents and knowledge graphs, where diverse data representations (documents, graphs, time-series, and geospatial data) can live together and be queried in place.
Closing thoughts
SurrealDB presents a compelling vision for modern data applications: a single, Rust-based engine that unifies multiple data paradigms under one algebra, supports real-time collaboration, and remains approachable for frontend developers through simple schemas and direct browser connections. Its emphasis on embedded usability and cloud distribution makes it adaptable to a wide range of environments—from edge devices to large-scale clusters. The combination of graph-first relationships, multi-model storage, granular permissions, and in-database JavaScript functions provides a toolkit for developers to build secure, performant apps quickly, without sacrificing flexibility.
If you’re exploring a project that requires a versatile data layer capable of handling diverse data shapes and real-time demands, SurrealDB offers a compelling option worth evaluating. The architecture invites experimentation—try defining tables and graphs, experiment with SurrealQL queries, and see how your application benefits from integrated data modeling, permissions, and live updates all in one place.
Images and visual references from the Input
Hero and branding
SurrealDB Hero image:

Illustrations and diagrams
Database and API security:

Multimodel database concept:

Graph and schema visuals:

Schema-to-client flow:

Browser synchronization:

Real-time queries:

Scale and distributed architecture:

Database plugins:

Cloud vs embedded:

Cloud and cloud-related visuals
SurrealDB Cloud hero:

Community and participation icons
Community section graphic:
Contributing graphic:
Getting started icons
Language and platform icons used in “Getting started” and “Documentation” sections
Rust icon, JavaScript icon, WebAssembly icon, Node.js icon, Python icon, Go icon, .NET icon, PHP icon, and Java icon (represented via the input’s linked assets)
Documentation and content visuals
Contents and feature visuals used in the document
Features and quick-look visuals:
and
If you’d like, I can tailor this blog post to a specific audience (e.g., backend engineers, frontend developers, data scientists) or expand any section with deeper examples, tutorials, or architectural diagrams.
Enjoying this project?
Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.
Repository:https://github.com/surrealdb/surrealdb
GitHub - surrealdb/surrealdb: SurrealDB
SurrealDB is a unified, multi-model database built in Rust....
github - surrealdb/surrealdb