This page aims to give details about some of the core concepts of SurrealDB, including the intended usecases, design choices, and overarching features.
Traditional database or backend layer
Relational, document, or graph
SurrealDB is, at its core, a document database. Each record is stored on an underlying key-value store storage engine, with the ability to store arbitrary arrays, objects, and many other types of data. However, SurrealDB isn't just a document database. Because of the way that SurrealDB handles Record IDs and the fetching of individual records from the underlying key-value storage engine, it can be used to store time-series ordered data, and highly-connected graph data. With the addition of an SQL-like query language (named SurrealQL), it is easy to create, update, and read data from across the database.
Single-node or distributed
SurrealDB is designed to be run in many different ways, and environments. Due to the separation of the storage and compute layers, SurrealDB can be run in embedded mode, as a vertically-scalable, single-node database server, or as a horizontally-scalable, multi-node, distributed cluster. In embedded mode, SurrealDB can be run with an in-memory storage engine, in a web browser it can persist data using IndexedDB, or it can persist data using the file-based RocksDB storage engine. As a database server, SurrealDB can currently be configured to store data using RocksDB, TiKV, or FoundationDB.
SurrealDB works similarly to other traditional relational databases, and document databases, with a few slight differences. SurrealDB is designed and developed to be a multi-tenant database platform with a high-level
namespace layer designed as a separation for each organisations, department, or development team. There is no limit to the number of namespaces on SurrealDB. Below this, the
database layer is similar to databases in other database management systems. There is no limit to the number of databases on each namespace. Within each database, data can be stored within
table definitions, otherwise known as collections in other database management systems. In SurrealDB each row or document is called a
record. Multiple authentication
scope definitions can be defined on each
database, allowing for custom authentication across tables, records, and fields.