Stage:
Public Beta
Available on self-hosted:
Yes
Broadcast from Database allows you to trigger Realtime broadcast messages directly from your database using Postgres triggers. Messages are read from the WAL and stored in the realtime.message table, automatically deleted after 3 days.
Key benefits
- Database-native broadcasting: Trigger broadcasts using Postgres functions and triggers.
- WAL-based delivery: Reads from the Write Append Log for reliable message delivery.
- Topic-based routing: Define topic patterns to send messages to specific channels.
- RLS integration: Messages tested against Row Level Security policies before sending.
- Format compatibility: Use realtime.broadcast_changes for Postgres Changes-compatible format.
How it works
Create a trigger function using realtime.broadcast_change, set up triggers on your tables for INSERT/UPDATE/DELETE, and define topic patterns. Clients subscribe to specific topics to receive events in real-time.
Broadcast from Database is valuable for:
- Notifying users of changes to specific records
- Real-time collaborative features
- Activity feeds and live notifications
- Database-driven real-time updates
Security
Supabase Admin role connects to the database and tests messages against RLS policies. Transactions are rolled back after authorization checks.
Broadcast from Database provides a powerful way to trigger real-time events directly from your database logic.