Supabase has introduced Broadcast from Database, a feature that allows for low-latency messages using client libraries, REST, or your Database.
This improvement offers benefits such as targeted actions, selective data sending, and reduced latency of sent messages.
The setup involves setting up Row-Level Security (RLS) policies, creating a function for detecting database changes, defining trigger conditions, and configuring client code to listen for changes.
Realtime Broadcast from Database sets up a replication slot for the realtime.messages table to listen for Write Ahead Log (WAL) changes and broadcast messages instantly.