Skip to content
NEW BLOG

Using Surrealism to build your own extensions

Read blog

1/2

Distributed storage engine illustration

Storage no one else has

Gen 3 architecture. TAPIR consensus, compute-storage separation, and object storage - the foundation beneath the context layer.

GEN 3 ARCHITECTURE

Storage redesigned from first principles

Most distributed databases were designed for provisioned disks attached to compute nodes. The storage engine places transactional data directly in cloud object storage and runs the database as stateless, elastic compute on top.

Gen 1: Single machine

Compute and storage on one box. Scaling means a bigger box. MySQL, Postgres self-hosted.

Gen 2: Proprietary separation

Storage separated into proprietary cloud tiers. Data locked in. Single vendor. Aurora, AlloyDB.

Gen 3: Object storage

Data in commodity object storage. Stateless compute on top. Scale independently.

Client
Load balancer layer
Request routed to SurrealDB TAPIR node, or SurrealDB read-proxy node
Availability Zone A
Highly-scalable read compute
SurrealDBread node
SurrealDBread node
SurrealDBread node
SurrealDBwrite node
Availability Zone B
Highly-scalable read compute
SurrealDBread node
SurrealDBread node
SurrealDBread node
SurrealDBwrite node
Availability Zone C
Highly-scalable read compute
SurrealDBread node
SurrealDBread node
SurrealDBread node
SurrealDBwrite node
SurrealDS
Object Storage (S3 / GCS / AFS / durable cold tier)

TAPIR CONSENSUS

No single leader. No split brain.

The storage engine uses TAPIR (Transactional Application Protocol for Inconsistent Replication). Each availability zone has its own write node, writes scale horizontally, and transactions commit once a quorum acknowledges. Lower latency than leader-based replication.

1 transaction 1 TAPIR decision

Every transaction is encapsulated within a TAPIR consensus decision. Transaction consensus is performed at the writing node, allowing writes to horizontally scale across all write nodes in a cluster.

TAPIR transaction
(majority commit)
TAPIR consensus
Storage enginedata storage
Storage enginedata storage
Storage enginedata storage

WRITE PATH

How a write transaction flows

From client request through the compute layer, into TAPIR quorum consensus, and down to durable object storage.

SurrealDB
SurrealDB Node
Query engine
Transaction engine
Storage engine(local disk and block storage)
Transaction engine
Periodic storage data compaction and compacted data storage
Asynchronous transaction log storage
SurrealDS
Object storage (S3 / GCS / AFS / durable cold tier)

RESILIENCE

Node failure and recovery

When a node fails, a replacement restores from object storage and replays the transaction log. Recovery time is independent of dataset size.

Client
Load balancer layer
Request routed to SurrealDB TAPIR node, or SurrealDB read-proxy node
Availability Zone A
Write queries are handled by write nodes
SurrealDBread proxy node
SurrealDBwrite node
Availability Zone B
Node B acknowledges writes.
Persistence succeeds, quorum fulfilled.
SurrealDBwrite node
Availability Zone C
Node C fails to acknowledge writes.
Persistence fails, but quorum fulfilled.
SurrealDBwrite node
LSM tree layers are retrieved from object storage so the query requests ranges which are not in the local storage cache
LSM tree layers are synced to object storage after range compaction
Transaction log written asynchronously to object storage
After the transaction log syncs from object storage, the node syncs the latest writes from a SurrealDB write node, and forms part of the quorum
On node recovery, data is restored from object storage, and the transaction log on object storage is tailed for the latest writes
SurrealDS
Object Storage (S3 / GCS / AFS / durable cold tier)

Behaviour:

Quorum commit: transaction is committed once a TAPIR quorum acknowledges the writes.
Durable log: committed writes are safe via a replicated write-ahead-log, with asynchronous durability to object storage for fast node recovery and secondary-region disaster recovery.
Catch-up: failed node restarts and replays transaction log from object storage (for reduced cost) and from cross-availability zone (for recent transactions).
Node crash: a new node catches up with the cluster, regardless of the existing local state, using transaction-log replay before joining the quorum.

Outcome:

Transaction commit succeeds with quorum majority
Client receives transaction success confirmation
SurrealDB TAPIR node in Availability Zone C catches up with cluster after restart
No split-brain / consistent ordering
Significant reduction in cross-availability zone traffic

IN PRACTICE

What Gen 3 storage delivers

Storage costs drop

Object storage costs a fraction of provisioned disk. The total dataset can far exceed the local storage of any running instance.

Cross-region replication

Data flows through object storage, not between nodes. The most expensive line item in traditional distributed databases is structurally reduced.

Scale to zero

Compute is stateless. Scale down to zero when idle - data persists in object storage. When demand returns, nodes restore from the durable store in seconds.

Instant recovery

A crashed node restores from object storage and replays the transaction log. Recovery time is independent of dataset size.

Instant branching

Clone a petabyte-scale database in seconds for development, testing, or experimentation. Git-like workflows for production data.

Built-in disaster recovery

Object storage is the durable tier (99.999999999% durability). No separate backup infrastructure. No snapshot schedules.

THE FULL STACK

From object storage to agent memory

No specialist agent database owns its storage layer. No memory middleware controls how data is persisted. The storage engine is the reason the context layer can scale down to zero, branch instantly, and recover from failures by design. No other product in the market owns this vertical.

Object storage

S3, GCS, Azure Blob - infinite, durable, cheap persistence.

Storage engine

TAPIR-based ACID transactions, compute-storage separation, quorum commits.

SurrealDB

Multi-model database: documents, graphs, vectors, time-series - unified in one transaction.

Spectron

Agentic memory: entity extraction, knowledge graph, temporal facts, hybrid retrieval.

GET STARTED

Build on the storage layer no one else has

From object storage to agent memory. Scale down to zero, branch instantly, recover by design. This is what the context layer is built on.