---
title: "Deployment & storage layer considerations | SurrealDB University"
description: "Deployment & storage layer considerations. A chapter of SurrealDB Fundamentals, a hands-on course with runnable examples."
url: https://surrealdb.com/learn/fundamentals/performance/deployment-storage
---

[Back to Courses](https://surrealdb.com/learn)

Course chapters

[SurrealDB Fundamentals](https://surrealdb.com/learn/fundamentals) [Introduction](https://surrealdb.com/learn/fundamentals) [Welcome to SurrealDB University](https://surrealdb.com/learn/fundamentals/intro/welcome) [Intro to SurrealDB](https://surrealdb.com/learn/fundamentals/intro/surrealdb) [Why SurrealQL is SQL-like](https://surrealdb.com/learn/fundamentals/intro/surrealql) [Part 1: Schemaless CRUD](https://surrealdb.com/learn/fundamentals/schemaless) [Introduction](https://surrealdb.com/learn/fundamentals/schemaless) [Record IDs](https://surrealdb.com/learn/fundamentals/schemaless/record-ids) [Inserting data](https://surrealdb.com/learn/fundamentals/schemaless/inserting-data) [Reading data](https://surrealdb.com/learn/fundamentals/schemaless/reading-data) [Updating data](https://surrealdb.com/learn/fundamentals/schemaless/updating-data) [Deleting data](https://surrealdb.com/learn/fundamentals/schemaless/deleting-data) [Part 2: Adding relationships](https://surrealdb.com/learn/fundamentals/relationships) [Introduction](https://surrealdb.com/learn/fundamentals/relationships) [Graph relations](https://surrealdb.com/learn/fundamentals/relationships/graph-relations) [Record links](https://surrealdb.com/learn/fundamentals/relationships/record-links) [Relational style joins](https://surrealdb.com/learn/fundamentals/relationships/relational-style) [Part 3: Making it schemafull](https://surrealdb.com/learn/fundamentals/schemafull) [Introduction](https://surrealdb.com/learn/fundamentals/schemafull) [Define tables, views and changefeeds](https://surrealdb.com/learn/fundamentals/schemafull/define-table) [Define fields, constraints and assertions](https://surrealdb.com/learn/fundamentals/schemafull/define-fields) [Schemafull CRUD](https://surrealdb.com/learn/fundamentals/schemafull/schemafull-crud) [Part 4: Making it secure](https://surrealdb.com/learn/fundamentals/security) [Introduction](https://surrealdb.com/learn/fundamentals/security) [Authentication](https://surrealdb.com/learn/fundamentals/security/authentication) [Query capabilities](https://surrealdb.com/learn/fundamentals/security/query-capabilities) [Part 5: Making it performant](https://surrealdb.com/learn/fundamentals/performance) [Introduction](https://surrealdb.com/learn/fundamentals/performance) [Indexing & data model considerations](https://surrealdb.com/learn/fundamentals/performance/index-data-model) [Deployment & storage layer considerations](https://surrealdb.com/learn/fundamentals/performance/deployment-storage) [Completion](https://surrealdb.com/learn/fundamentals/completion) Certification Pending completion

# Deployment & storage layer considerations

So far, throughout this course, we have been talking about data.

- Why data models matter
- How to manipulate data
- How to connect data
- How to index data

We'll still talk about data in this last lesson about storage layer and deployment considerations. The difference is we'll be talking about it from the perspective of a database manager rather than a database user.

We'll briefly cover:

- Why the separation of storage and compute matters
- The different ways of running SurrealDB and the supported key-value storage engines

## Why the separation of storage and compute matters

The separation of storage and compute has been a trend that first became popular with analytical databases (OLAP) and which has since made its way into operational databases (OLTP).

The key reason for separating storage and compute is so that you can scale your resources separately.

This has several benefits such as:

- Less wasted capacity as scale is optimised for each workload
- Greater cost efficiency
- Greater flexibility
- Better fault tolerance

This has also allowed us to offer various key-value storage engines you can choose from, depending on your needs.

## The different ways of running SurrealDB and the supported key-value storage engines

There are three ways of running SurrealDB:

- Directly in the browser
- As a single-node server or in embedded devices
- As a multi-node cluster in the cloud

There are also a number of storage engines to choose from. Each engine supports a transaction-based approach, with the ability to support the reading and writing of individual keys and key ranges within each transaction.

Let's go through each of these.

### Running SurrealDB directly in the browser

Running SurrealDB directly in the browser is the way you have been interacting with SurrealDB throughout the course. The embedded SurrealDB Studio interface runs SurrealDB in WebAssembly (WASM), so you can execute SurrealQL without installing anything.

For this course, each lesson starts with a fresh in-memory database. When you load a dataset or run a query, the data lives only for that session in the browser tab - which keeps the examples predictable and fast.

If you build your own browser apps with the [JavaScript SDK](https://surrealdb.com/docs/languages/javascript/concepts/embedded-engines), you can also persist data with [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) via the `indxdb://` connection string. That storage lives inside your browser in a sandboxed environment, with keys and values serialised as binary data.

### Running SurrealDB on a single-node server or in embedded devices

SurrealDB is easy to install and run, whether you are running everything on your laptop, on an IoT device or as a single-node server in the cloud.

You'll find [installation](https://surrealdb.com/docs/self-hosted/installation) and [running](https://surrealdb.com/docs/self-hosted/file-backed) instructions for Linux, macOS, Windows and Docker in our documentation, where you can install and run SurrealDB with one command each.

The storage engines you can choose between are RocksDB (the default for single-node production) and SurrealKV.

**RocksDB**

- Was originally a fork of Google's LevelDB but was then developed and maintained by Meta (Facebook) entirely in C++.
- It's optimised for fast, low-latency storage such as flash drives and high-speed disk drives using the log-structured merge-tree data structure (LSM).
- LSM data structures are highly efficient for write-heavy workloads as they minimise the number of disk writes and require less space than B-Trees, as they don't require constant reorganisation of data.

**SurrealKV**

[SurrealKV](https://github.com/surrealdb/surrealkv) is SurrealDB's own embedded storage engine, written in Rust. It is also LSM-based, with optional [versioned / time-travel reads](https://surrealdb.com/docs/reference/query-language/statements/select#the-version-clause) when versioning is enabled at startup - useful for temporal queries and audit-style workloads.

SurrealKV is still under active development. RocksDB remains the recommended default for critical production workloads on a single node, but SurrealKV is worth experimenting with for local-first and embedded use cases.

### Running SurrealDB on a multi-node cluster in the cloud

Highly available, horizontally scalable deployments need **shared distributed storage** - a backend that every query node can reach with transactional consistency. A single RocksDB directory on one machine is still a [single-node deployment](https://surrealdb.com/docs/running/file-backed), not a cluster.

[SurrealDB Enterprise](https://surrealdb.com/docs/manage/observability/enterprise-observability) is run on SurrealDB's own distributed storage layer for multi-node deployments. It is available on [SurrealDB Cloud](https://surrealdb.com/cloud) Scale tiers and for Enterprise self-hosted installations on Kubernetes. We won't go into how it works here - that is operator-level detail - but it is the path to geo-replicated, highly available clusters when you outgrow a single node.

In these architectures, the distributed storage layer is the stateful part of the system. SurrealDB query nodes stay comparatively stateless: coordination and durability live in the storage tier, which is what lets you scale compute and storage independently.

## Summary

We've covered quite a lot, and as we've seen, SurrealDB was designed from the start to have unparalleled deployment flexibility, ranging from embedded devices to distributed multi-node clusters and even embedded directly in your website using WebAssembly (WASM).

If you want the power and flexibility of SurrealDB without the pain of managing infrastructure, sign up for [SurrealDB Cloud](https://surrealdb.com/cloud) for a fully managed solution where you can focus on building your application, and we'll take care of the rest.

Previous

Indexing & data model considerations

[Previous](https://surrealdb.com/learn/fundamentals/performance/index-data-model)

Next lesson

Completion

[Next lesson](https://surrealdb.com/learn/fundamentals/completion)

```json
{"@context":"https://schema.org","@type":"Course","name":"SurrealDB Fundamentals","description":"The most efficient way to learn SurrealDB through guided hands-on learning","url":"https://surrealdb.com/learn/fundamentals","inLanguage":"en","isAccessibleForFree":false,"provider":{"@type":"Organization","name":"SurrealDB","url":"https://surrealdb.com"},"hasPart":[{"@type":"LearningResource","name":"SurrealDB Fundamentals","url":"https://surrealdb.com/learn/fundamentals"},{"@type":"LearningResource","name":"Introduction","url":"https://surrealdb.com/learn/fundamentals"},{"@type":"LearningResource","name":"Welcome to SurrealDB University","url":"https://surrealdb.com/learn/fundamentals/intro/welcome"},{"@type":"LearningResource","name":"Intro to SurrealDB","url":"https://surrealdb.com/learn/fundamentals/intro/surrealdb"},{"@type":"LearningResource","name":"Why SurrealQL is SQL-like","url":"https://surrealdb.com/learn/fundamentals/intro/surrealql"},{"@type":"LearningResource","name":"Part 1: Schemaless CRUD","url":"https://surrealdb.com/learn/fundamentals/schemaless"},{"@type":"LearningResource","name":"Introduction","url":"https://surrealdb.com/learn/fundamentals/schemaless"},{"@type":"LearningResource","name":"Record IDs","url":"https://surrealdb.com/learn/fundamentals/schemaless/record-ids"},{"@type":"LearningResource","name":"Inserting data","url":"https://surrealdb.com/learn/fundamentals/schemaless/inserting-data"},{"@type":"LearningResource","name":"Reading data","url":"https://surrealdb.com/learn/fundamentals/schemaless/reading-data"},{"@type":"LearningResource","name":"Updating data","url":"https://surrealdb.com/learn/fundamentals/schemaless/updating-data"},{"@type":"LearningResource","name":"Deleting data","url":"https://surrealdb.com/learn/fundamentals/schemaless/deleting-data"},{"@type":"LearningResource","name":"Part 2: Adding relationships","url":"https://surrealdb.com/learn/fundamentals/relationships"},{"@type":"LearningResource","name":"Introduction","url":"https://surrealdb.com/learn/fundamentals/relationships"},{"@type":"LearningResource","name":"Graph relations","url":"https://surrealdb.com/learn/fundamentals/relationships/graph-relations"},{"@type":"LearningResource","name":"Record links","url":"https://surrealdb.com/learn/fundamentals/relationships/record-links"},{"@type":"LearningResource","name":"Relational style joins","url":"https://surrealdb.com/learn/fundamentals/relationships/relational-style"},{"@type":"LearningResource","name":"Part 3: Making it schemafull","url":"https://surrealdb.com/learn/fundamentals/schemafull"},{"@type":"LearningResource","name":"Introduction","url":"https://surrealdb.com/learn/fundamentals/schemafull"},{"@type":"LearningResource","name":"Define tables, views and changefeeds","url":"https://surrealdb.com/learn/fundamentals/schemafull/define-table"},{"@type":"LearningResource","name":"Define fields, constraints and assertions","url":"https://surrealdb.com/learn/fundamentals/schemafull/define-fields"},{"@type":"LearningResource","name":"Schemafull CRUD","url":"https://surrealdb.com/learn/fundamentals/schemafull/schemafull-crud"},{"@type":"LearningResource","name":"Part 4: Making it secure","url":"https://surrealdb.com/learn/fundamentals/security"},{"@type":"LearningResource","name":"Introduction","url":"https://surrealdb.com/learn/fundamentals/security"},{"@type":"LearningResource","name":"Authentication","url":"https://surrealdb.com/learn/fundamentals/security/authentication"},{"@type":"LearningResource","name":"Query capabilities","url":"https://surrealdb.com/learn/fundamentals/security/query-capabilities"},{"@type":"LearningResource","name":"Part 5: Making it performant","url":"https://surrealdb.com/learn/fundamentals/performance"},{"@type":"LearningResource","name":"Introduction","url":"https://surrealdb.com/learn/fundamentals/performance"},{"@type":"LearningResource","name":"Indexing \u0026 data model considerations","url":"https://surrealdb.com/learn/fundamentals/performance/index-data-model"},{"@type":"LearningResource","name":"Deployment \u0026 storage layer considerations","url":"https://surrealdb.com/learn/fundamentals/performance/deployment-storage"},{"@type":"LearningResource","name":"Completion","url":"https://surrealdb.com/learn/fundamentals/completion"}]}
```

```json
{"@context":"https://schema.org","@type":"LearningResource","name":"Deployment \u0026 storage layer considerations","description":"Deployment \u0026 storage layer considerations","url":"https://surrealdb.com/learn/fundamentals/performance/deployment-storage","learningResourceType":"lesson","isPartOf":{"@type":"Course","name":"SurrealDB Fundamentals","url":"https://surrealdb.com/learn/fundamentals"},"position":30}
```

```json
{"@context":"https://schema.org","@type":"Organization","name":"SurrealDB","url":"https://surrealdb.com","logo":"https://surrealdb.com/assets/static/logo.BG7_TG2b.svg","description":"SurrealDB is the unified data layer for AI. A multi-model database for documents, graphs, vectors, and time-series.","foundingDate":"2022","hasCertification":[{"@type":"Certification","name":"SOC 2 Type 2"},{"@type":"Certification","name":"GDPR"},{"@type":"Certification","name":"Cyber Essentials Plus"},{"@type":"Certification","name":"ISO 27001"}],"owns":[{"@type":"SoftwareApplication","name":"SurrealDB","url":"https://surrealdb.com/surrealdb"},{"@type":"SoftwareApplication","name":"Agent Memory","url":"https://surrealdb.com/agent-memory"}],"knowsAbout":["multi-model databases","document databases","graph databases","vector search","time-series databases","SurrealQL","Agent Memory","real-time databases","embedded databases","context layer","graph ontology","distributed database","knowledge graphs","distributed transaction protocols","highly-scalable databases"],"sameAs":["https://www.wikidata.org/wiki/Q124316308","https://github.com/surrealdb/surrealdb","https://twitter.com/surrealdb","https://www.youtube.com/@surrealdb","https://www.linkedin.com/company/surrealdb","https://discord.gg/surrealdb","https://www.reddit.com/r/surrealdb","https://www.instagram.com/surrealdb","https://medium.com/surrealdb","https://dev.to/surrealdb"]}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://surrealdb.com"},{"@type":"ListItem","position":2,"name":"Learn","item":"https://surrealdb.com/learn"},{"@type":"ListItem","position":3,"name":"Deployment storage","item":"https://surrealdb.com/learn/fundamentals/performance/deployment-storage"}]}
```
