Overview
The realtime system lets you push updates to connected clients as data changes. Use it for live notifications, chat, collaborative editing, and any feature that needs instant updates.Technology Stack
Database Schema
Channels Table
Channels are named topics that clients subscribe to:Messages Table
Messages are published to channels:Permission Model
Default Permissions (RLS Disabled)
By default, all authenticated users can subscribe to any channel and publish messages.Enabling Access Control
Enable RLS on therealtime.channels and realtime.messages tables for fine-grained control:
Message Flow
System Events (Database Triggers)
When a database table changes, Yboard can automatically publish notifications:- Row is inserted/updated/deleted in a watched table
- PostgreSQL trigger fires
- Message is published to the configured channel
- Connected WebSocket clients receive the update
- Webhook endpoints are called (if configured)
Client Events (User-Initiated)
Clients can also publish messages directly:- Client sends a message via WebSocket or REST API
- Message is stored in the
messagestable - All subscribers on the channel receive the message
WebSocket Events
Client-to-Server Events
Server-to-Client Events
Socket Message Structure
Webhook Delivery
Request Format
Webhooks send POST requests with the message payload:Delivery Guarantees
- At-least-once delivery
- Automatic retries on failure (3 attempts)
- Configurable webhook URLs per channel
Message Retention
Messages are retained based on your project plan. Old messages are automatically cleaned up.Best Practices
- Use specific channels — Don’t subscribe to everything; create channels per feature
- Monitor delivery — Check webhook logs for failed deliveries
- Enable RLS for production apps to control access
- Keep payloads small — Send IDs and let clients fetch full data if needed
- Handle reconnections — WebSocket clients should implement reconnect logic
Limitations
- Maximum message size: 64 KB
- Maximum channels per project: 1000
- WebSocket connections are subject to plan limits