NEW

New University Course: SurrealDB for AI Engineers

Start the course

1/3

REALTIME

Realtime, built in

LIVE SELECT. Any query becomes a realtime feed over WebSockets, with the same filters and permissions.
DEFINE EVENT. Logic that runs in the database on every write, for validation, fan-out and derived writes.
Changefeeds. A durable, ordered stream of changes per table, replayable from any point in the retention window.

LIVE QUERIES

Any query can become a subscription

Add LIVE to a SELECT and the same filter, permissions and shape stream to the client on every matching change.

LIVE SELECT

Subscribe with the query you already wrote

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 TABLE product CHANGEFEED 7d;

SHOW CHANGES FOR TABLE product
SINCE time::now() - 1h LIMIT 100;
LIVE QUERIES

What the client receives

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 } }

Pushed from the engine that made the change

Subscribe once

Clients subscribe once and the engine pushes changes as they commit.

One system

Live queries and changefeeds come from the database itself, so there is one thing to deploy.

Consistent with the write

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

THE PLATFORM

Everything an application and its agents know. Five surfaces, one engine.

IN PRODUCTION

Trusted at scale. Samsung, Nvidia, Verizon, Tencent, and Walmart run on SurrealDB.

14,000+

Developers building on SurrealDB Cloud

4M+

Developers building on SurrealDB worldwide

FROM THE TEAMS

SurrealDB gives us a foundation where we can unify semantic search, knowledge graphs, and AI-driven decision making without stitching together multiple systems. Collapsing responsibility into SurrealDB has become our default engineering posture.
Justin Foley

VP of Engineering, Later

GET STARTED

Make your data reactive. Subscribe with LIVE SELECT, react with DEFINE EVENT, replay with changefeeds.