SurrealDB logo

SurrealDB is the ultimate cloud database for tomorrow's applications

Develop easier.Build faster.Scale quicker.

With an SQL-style query language, real-time queries with highly-efficient related data retrieval, advanced security permissions for multi-tenant access, and support for performant analytical workloads, SurrealDB is the next generation serverless database.

View all features
Keep me updated

Why SurrealDB?

SurrealDB is an innovative NewSQL cloud database, suitable for serverless applications, jamstack applications, single-page applications, and traditional applications. It is unmatched in its versatility and financial value, with the ability for deployment on cloud, on-premise, embedded, and edge computing environments. For a hassle-free setup, get started with SurrealDB Cloud in one-click.

Jamstack apps
Serverless apps

Develop easier

There is no need for your team to learn new complicated database languages. Getting started with SurrealDB is as simple as one command - and advanced functionality is simple to understand, whilst still being fast and performant.

Build faster

SurrealDB simplifies your database and API stack, removing the need for most server-side components. As a web database, client-side applications can be built with direct connections to SurrealDB, while traditional server-side development techniques can still leverage the powerful but simple querying and analytics abilities.

Scale quicker

Forget about scaling databases, servers, loadbalancers, and API endpoints. SurrealDB takes the hassle out of your stack, enabling you to grow and operate at scale with a highly-available, highly-scalable distributed platform. Deploy anywhere, or keep it simple with SurrealDB Cloud.

A highly-scalable NewSQL database

SurrealDB is a flexible, developer-friendly, fully ACID transactional, realtime document-graph web database for serverless applications. Never again worry about database provisioning, scaling, sharding, replication, or correctness.

Document & graph database

JOIN-less deep fetching

Distributed ACID transactions

Built with Rust

Structured and un-structured data

SQL-style querying

GraphQL and REST API

Support for multi-tenant apps

Multi-row, multi-table transactions

Online and offline data sync

In-built access and permissions

Multi-column and full-text indexes

Incrementally computed views

Distributed and highly-scalable

No complex back-end servers and APIs

Improved data modelling

SurrealDB doesn't force you into setting up your data model in any one way. Instead you can choose between simple documents, documents with embedded fields, or related graph connections between records. Use schemafull or schemaless tables giving you the flexibility to store whatever you need.

Once stored in SurrealDB, all data is strongly typed, with the ability to convert between different types seamlessly - and numbers can be stored and computed with 64 bit precision or as arbritrary length decimals.

Get started with SurrealDB
-- Create a 'user' record
	age = <int> 34,
	enabled = true,
	-- Store the current time
	created_at = time::now(),
	-- Specify embedded fields
	name.first = "Tobie",
	name.last = "Morgan Hitchcock",
	-- Add a field which is computed from other fields
	name.full = <string> string::join(' ', name.first, name.last),
	-- Add an array whose values point to other remote records
	friends = [user:gna732gnajan74hj, user:gna732gnajan74hj],
-- Select all users and fetch the users' friends' names
SELECT *, friends.*.name.full AS friends FROM user;

-- Set a variable to be used in subsequent statements
LET $tobie = (SELECT * FROM user WHERE name.first = "Tobie");

-- Select all users with complex graph traversal
	-- Select all users who like this user
	<-like<-user AS friends,
	-- Select all products which friends have purchased
	<-like<-user->purchase->product AS recommended
	-- Only look at the single user selected above
	FROM $tobie

Powerful querying abilities

The primary method of querying SurrealDB is using SurrealQL, a similar but modified version of traditional SQL. SurrealQL enables linked documents to be traversed and queried efficiently, while still using an imperative language which remains understandable by data scientists.

With an innovative, but simple-to-understand, SQL language developers or data scientists can use a myriad of different techniques to store, query, and analyse the data in SurrealDB.

Get started with SurrealDB

Simplified data analytics

SurrealDB is designed to be quick to setup, and even quicker to implement. Multi-column indexes can be easily added and removed as your application evolves, allowing for strongly consistent reads and writes, and highly-performant reads.

Pre-computed table views allow superfast and highly-efficient aggregated data for queries which are known upfront - with simple view definition as easy as writing an SQL statement.

Get started with SurrealDB
-- Add a new 'user' record with some basic attributes
	age = 34,
	gender = 'm',
	name = 'Tobie Morgan Hitchcock'

-- Define a table which aggregates data from another table
DEFINE TABLE users_by_gender
			count() AS total,
			math::mean(age) AS average_age
		FROM user
		GROUP BY gender
-- Specify access permissions for the 'post' table
		FOR select
			-- Published posts can be selected
			WHERE published = true
			-- A user can select all their own posts
			OR user = $
		FOR create, update
			-- A user can create or update their own posts
			WHERE user = $
		FOR delete
			-- A user can delete their own posts
			WHERE user = $
			-- Or an admin can delete any posts
			OR $auth.admin = true

Faster app development times

WIth permissions in-built from the ground up, SurrealDB is the perfect web-database for serverless applications. Easily specify permissions with easy-to-write SQL statements, ensuring that only the correct users can access the specified data that they have permission to select or modify.

With support for SSL/TLS, Single-Sign-On, external 3rd party authentication, JWT token based authentication, and custom business authentication logic - SurrealDB offers strong security, with the flexibility of custom authentication methods that suit your app or business.

Get started with SurrealDB

Superpowered database functionality

When connecting with SurrealDB, all connections are made using WebSockets, allowing for bi-directional data syncing. Dependent on data access permissions, client-based document subscriptions are triggered in real-time whenever changes are made to the data.

Data subscriptions can be specified for whole tables, filtered result sets, or individual records - enabling a multitude of different use-cases in all types of applications.

Get started with SurrealDB
-- Subscribe to all changes to documents which match
		account = $auth.account
		OR public = true

-- Subscribe to all changes to a single 'post' record
LIVE SELECT * FROM post:c569rth77ad48tc6s3ig;

-- Stop receiving change notifications
KILL "1986cc4e-340a-467d-9290-de81583267a2";

Database libraries and clients

SurrealDB builds and maintains first-party database clients for a number of popular languages including Javascript, Typescript, Node.js, Deno, Rust, and Golang. All clients connect to SurrealDB using a binary protocol over a WebSocket connection for low-latency and efficient parsing, leading to blazingly fast queries.

WebAssembly Beta

npm install surrealdb.wasm
GitHub Documentation

Javascript Beta

npm install surrealdb.js
GitHub Documentation

Golang Beta

go get
GitHub Documentation

Python Coming soon

pip install surrealdb
GitHub Documentation

Rust Beta

cargo install surrealdb
GitHub Documentation

Node.js Beta

npm install surrealdb.node
GitHub Documentation

Deno Coming soon

import * as surreal from "";
GitHub Documentation

C Coming soon

#include <surrealdb.h>
GitHub Documentation

Javascript framework connectors

In addition to the client libraries for the popular languages, SurrealDB maintains database client connectors for some of the popular Javascript frameworks, including Angular.js, and Ember.js. These connectors support real-time data asubscriptions and notifications using a binary protocol over a WebSocket connection, enabling advanced application functionality and awesome performance.

Ember.js Complete

ember install ember-surreal
GitHub Documentation

Angular.js Coming soon

npm install angular-surreal
GitHub Documentation

React.js Complete

npm install surrealdb
GitHub Documentation

Vue.js Coming soon

npm install surrealdb
GitHub Documentation

We are building SurrealDB for everyone

SurrealDB is being built in the open. We would love for you to be involved.

Find us on GitHub
View our open source projects