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 2LIVESELECT * FROMmessageWHEREroom=room:general; 3 4-- Subscribe to changes on a specific record 5LIVESELECT * FROMuser: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.
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.
Live queries are persistent subscriptions. When you execute a LIVE SELECT statement, SurrealDB monitors the matching data and pushes changes to your client over WebSocket whenever records are created, updated, or deleted.
No. SurrealDB's live queries and event system replace the need for external message brokers like Kafka or RabbitMQ for many real-time use cases. The database itself is the event source.
GET STARTED
Build real-time applications
Live queries, events, and WebSocket subscriptions - built into the database.