A scalable, distributed, collaborative, document-graph database, for the realtime web
A scalable, distributed, collaborative, document-graph database, for the realtime web
SurrealDB is a multi-model database built in Rust designed to unify multiple data models into a single engine. SurrealDB combines document, graph, relational, time-series, geospatial and key-value data types with powerful search and retrieval functionalities (full-text, vector, hybrid) and real-time and event-driven capabilities, enabling developers to build powerful applications faster and more efficiently. SurrealDB can also be used as a backend-as-a-service given its support for end user authentication. Given that it’s a single Rust binary, SurrealDB can run embedded (in‐app), in the browser (via WebAssembly), in the edge, self-hosted as single backend node, or in a distributed cluster in the cloud.
SurrealDB is used for data-intensive systems such as applications requiring multiple data types, data layer for AI agents, knowledge graphs, real-time apps (e.g. recommendation engines, fraud detection systems) and embedded/edge systems. With SurrealDB, you can simplify your database and API infrastructure, reduce development time, and build secure, performant apps quickly and cost-effectively.
Key features of SurrealDB include:
View the features, the latest releases, and documentation.
For guidance on installation, development, deployment, and administration, take a look at the following resources:
Getting started with SurrealDB is as easy as starting up the SurrealDB database server, choosing your platform, and integrating its SDK into your code. You can easily get started with your platform of choice by reading one of our tutorials.
Server side code
Client side apps
SurrealDB is available as a managed cloud service. Forget about infrastructure operations, monitoring, backups or capacity planning. SurrealDB Cloud allows you to focus on building great products using the power and flexibility of SurrealDB in just a few clicks. Grow from prototype to enterprise-scale. The SurrealDB Cloud scalable architecture allows your database to evolve as your application grows, ensuring you are always ahead of demand. However if you want to deploy SurrealDB yourself, keep reading below.
SurrealDB is designed to be simple to install and simple to run - using just one command from your terminal. In addition to traditional installation, SurrealDB can be installed and run with HomeBrew, Docker, or using any other container orchestration tool such as Docker Compose, Docker Swarm, Rancher, or in Kubernetes.
The quickest way to get going with SurrealDB on macOS is to use Homebrew. This will install both the command-line tools, and the SurrealDB server as a single executable. If you don't use Homebrew, follow the instructions for Linux below to install SurrealDB.
brew install surrealdb/tap/surrealIf you want to test a version with the latest features, published every night, install the nightly version:
brew install surrealdb/tap/surreal-nightlyThe easiest and preferred way to get going with SurrealDB on Unix operating systems is to install and use the SurrealDB command-line tool. Run the following command in your terminal and follow the on-screen instructions.
curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | shIf you want to run a beta release, before the next version is released, the beta version:
curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --betaIf you want to test a version with the latest features, published every night, install the nightly version:
curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --nightlyThe easiest and preferred way to get going with SurrealDB on Windows is to install and use the SurrealDB command-line tool. Run the following command in your terminal and follow the on-screen instructions.
iwr https://windows.surrealdb.com -useb | iexIf you want to test a version with the latest features, published every night, install the nightly version:
iex "& { $(irm https://windows.surrealdb.com) } -Nightly"Docker can be used to manage and run SurrealDB database instances without the need to install any command-line tools. The SurrealDB docker container contains the full command-line tools for importing and exporting data from a running server, or for running a server itself.
docker run --rm --pull always --name surrealdb -p 8000:8000 surrealdb/surrealdb:latest startFor just getting started with a development server running in memory, you can pass the container a basic initialization to set the user and password as root and enable logging.
docker run --rm --pull always --name surrealdb -p 8000:8000 surrealdb/surrealdb:latest start --log info --user root --pass root memoryWith strongly-typed data types, data can be fully modelled right in the database.
UPDATE person SET
waist = <int> "34",
height = <float> 201,Bug: index on an array field gives `acl = x` two answers (count 1, rows none), and `CONTAINS`/`CONTAINSANY` never use it
panicked at surrealdb/kvs-rocksdb/src/owned_tx.rs
Bug: embedded engine: `DEFINE TABLE IF NOT EXISTS` succeeds, but the next read in the same session reports the table does not exist (concurrent first access to a fresh database)
3.3.0: REBUILD INDEX on a large DiskANN (I8, 4096-dim) index fails with TransactionConflict; CONCURRENTLY leaves compacting:true with KNN ~270x slower
Bug: concurrent writes during `DEFINE`/`REBUILD INDEX … CONCURRENTLY` can leave stale (and occasionally missing) index entries
Bug: `TIMEOUT $param` on a SELECT inside a closure is silently ignored (the parameter reads as NONE)
Bug: DEFINE INDEX … CONCURRENTLY does not become ready while the table receives sustained writes (RocksDB)
Bug: `DEFINE INDEX … CONCURRENTLY` can permanently miss writes committed while the build starts (first build only; `REBUILD INDEX … CONCURRENTLY` does not have this window)
HNSW: a KNN query during DEFINE INDEX ... CONCURRENTLY returns the whole table (3.2.4) or no rows (nightly), with no error
HNSW: INFO FOR INDEX reports ready for minutes while the graph is still being built, and KNN meanwhile returns fewer than K rows (3.2.4, 3.3.0-beta.3; fixed on nightly)