Skip to content
NEW

Introducing SurrealDB Studio, the new official app of SurrealDB

Learn more

1/3

REALTIME

Realtime, built in

Subscribe to a query and receive every change as it commits. LIVE SELECT turns any query into a realtime feed over WebSockets, DEFINE EVENT runs server-side logic on writes, and changefeeds give you an ordered, durable stream of mutations - no message broker to run alongside the database.

01 |LIVE QUERIES

Any query can become a subscription

Add LIVE to a SELECT and the same filter, permissions, and shape you already use stream to the client on every matching change - full records or just the diff.

LIVE SELECT * FROM message
WHERE channel = $auth.channel;

-- The client receives each matching change as it commits:
-- { action: "CREATE", result: { id: message:9f2, text: "hi" } }
-- { action: "UPDATE", result: { id: message:9f2, text: "hey" } }
-- { action: "DELETE", result: { id: message:9f2 } }

LIVE SELECT

Subscribe with the query you already wrote

A live query carries the same WHERE clause and permissions as a normal one. The client receives new, updated, and deleted records as they commit.

LIVE SELECT * FROM document
WHERE account = $auth.account OR public = true;

-- Stream only what changed, not the whole record
LIVE SELECT DIFF FROM task
WHERE status != "closed";

-- Stop receiving updates
KILL "0189d1af-8f1c-7f3a-9d4e-2c1b6a5e0f77";

EVENTS AND CHANGEFEEDS

React on write, replay on demand

DEFINE EVENT runs logic in the engine when data changes; a changefeed keeps an ordered, durable record of mutations you can replay from any point.

DEFINE TABLE product CHANGEFEED 7d;

SHOW CHANGES FOR TABLE product
SINCE d"2024-01-01T00:00:00Z" LIMIT 100;

Reactive data without a broker

Subscriptions, triggers, and durable change streams are part of the engine - so realtime is a query, not a second system to run.

02 |ONE ENGINE

No message broker in the middle

The usual realtime stack polls the database, or wires a broker and a change-data-capture pipeline beside it. SurrealDB pushes changes from the engine that made them.

No polling

Clients subscribe once and the engine pushes changes as they commit, instead of re-querying on a timer and hoping to catch updates.

No separate pipeline

Live queries and changefeeds come from the database itself - there is no broker, CDC connector, or stream processor to deploy and keep in sync.

Consistent with the write

Updates are emitted by the transaction that made them, so subscribers see exactly what committed, in order.

Keep exploring

GET STARTED

Make your data reactive

Subscribe with LIVE SELECT, react with DEFINE EVENT, and stream changes - all from SurrealDB.

SamsungNVIDIAAppleVerizonTencent

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

SurrealDB

The unified data layer for AI

Graph, vector, document, and relational in one engine.
Agent Memory that connects and retrieves context wherever your data lives.

Explore with AI

Stay in the loop

Tutorials, AI agent recipes, and product updates, every two weeks.

Independently verified

SOC 2 Type 2

GDPR

Cyber Essentials Plus

ISO 27001

Trust Centre

Copyright © 2026 SurrealDB Ltd. Registered in England and Wales. Company no. 13615201

Registered address: 3rd Floor 1 Ashley Road, Altrincham, Cheshire, WA14 2DT, United Kingdom

Trading address: Huckletree Oxford Circus, 213 Oxford Street, London, W1D 2LG, United Kingdom