Skip to main content
Yboard Realtime provides pub/sub messaging powered by PostgreSQL triggers, WebSockets, and webhooks.

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 the realtime.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:
  1. Row is inserted/updated/deleted in a watched table
  2. PostgreSQL trigger fires
  3. Message is published to the configured channel
  4. Connected WebSocket clients receive the update
  5. Webhook endpoints are called (if configured)

Client Events (User-Initiated)

Clients can also publish messages directly:
  1. Client sends a message via WebSocket or REST API
  2. Message is stored in the messages table
  3. 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

  1. Use specific channels — Don’t subscribe to everything; create channels per feature
  2. Monitor delivery — Check webhook logs for failed deliveries
  3. Enable RLS for production apps to control access
  4. Keep payloads small — Send IDs and let clients fetch full data if needed
  5. 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