Skip to content
NEW BLOG

Using Surrealism to build your own extensions

Read blog

1/2

Real-time applications hero illustration

Real-time, event-driven applications

Live queries, events, WebSocket subscriptions, and collaborative patterns - built into the database. No message broker, no polling, no glue code.

LIVE QUERIES

Subscribe to changes, not to polling intervals

Live queries push changes to connected clients the moment data is modified. No polling, no message broker, no change data capture pipeline. The database is the event system.

1-- Subscribe to all changes on messages in a chat room
2LIVE SELECT * FROM message WHERE room = room:general;
3
4-- Subscribe to changes on a specific record
5LIVE SELECT * FROM user:jaime;

EVENTS & TRIGGERS

Reactive workflows inside the database

TABLE and FIELD events fire on data changes. Build reactive workflows - notifications, audit logs, computed fields, cascading updates - without external event systems.

Table events

Fire SurrealQL on CREATE, UPDATE, or DELETE for any table. Build audit trails, notifications, and cascading logic.

Field-level triggers

React to changes on specific fields. Compute derived values, enforce business rules, and trigger side effects.

WebSocket streaming

Connect clients over WebSocket for real-time data streaming. No separate message broker required.

Collaborative patterns

Build collaborative applications - shared editors, multiplayer games, real-time dashboards - with built-in conflict resolution.

REAL-TIME AGENTS

Real-time coordination for multi-agent systems

Live queries are the transport layer for multi-agent coordination. When one agent commits a finding, live queries push the update to every other agent in real time. No polling, no message broker, no stale context.

Agent handoffs

When Agent A completes a task, the result is immediately visible to Agent B through live queries. No explicit message passing required.

Context updates

Changes to shared memory, knowledge graphs, or application state are pushed to all connected agents the moment they commit.

Event-driven workflows

TABLE and FIELD events trigger reactive agent behaviours. An agent can respond to data changes without polling or external queues.

GET STARTED

Build real-time applications

Live queries, events, and WebSocket subscriptions - built into the database.