Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 8 min read Announcement mediumAdept

Realtime: Multiplayer Edition

Supabase Realtime's Broadcast and Presence features are now generally available, with every feature organized around Channels that also carry Postgres change events. Broadcast is ephemeral pub/sub that bypasses the database, which suits things like cursor positions. Presence syncs shared state to new joiners and drops users automatically when they disconnect. Realtime originally chose logical replication over LISTEN/NOTIFY because NOTIFY payloads are capped at 8,000 bytes. It now runs as a globally distributed Elixir cluster on Fly, using Phoenix PubSub for Broadcast and the delta-CRDT-based Phoenix Tracker for Presence, and supabase-js examples show both features in use.

Related posts

  • Realtime: Broadcast from Database

    Supabase mediumAdept

    Supabase Realtime's Broadcast from Database sends database change events to clients through Postgres triggers that write to a `realtime.messages` table. Realtime reads that table via a replication slot on its WAL publication and broadcasts each new row to the target channel immediately. Compared with polling-based Postgres Changes it needs more setup (RLS policies, a trigger function using `realtime.broadcast_changes` or `realtime.send`, and private channels on the client). In return it can target specific operations, send only chosen columns, route messages to channels with SQL, and scale to tens of thousands of concurrent subscribers. `realtime.send` catches exceptions and reports errors via `pg_notify`, so a failed send does not break the trigger.

  • Supabase Realtime: Broadcast and Presence Authorization

    Supabase mediumAdept

    Supabase Realtime now supports authorization for Broadcast and Presence channels using Postgres Row Level Security policies on a managed `realtime.messages` table, where SELECT policies govern receiving and INSERT policies govern sending. Clients opt in with a `private: true` channel config, and policies can reference the channel name via `realtime.topic()` and the extension column. On subscription, the server loads JWT claims into a Postgres transaction with `set_config`, runs rolled-back SELECT/INSERT probes against the table, and caches the resulting per-socket policy map in memory. This adds latency only at connect time, and policies are re-checked on reconnect or token refresh, so token expiry controls how quickly policy changes take effect.

  • Realtime or Pipelines? How to choose the right tool

    Supabase mediumAdept

    Supabase Realtime and Supabase Pipelines both read Postgres changes via logical replication but serve different jobs. Realtime pushes changes to client apps over WebSocket with best-effort delivery, temporary replication slots, and a per-subscriber RLS check for every change, typically under 100ms. Pipelines is managed CDC to analytical destinations like BigQuery, with persistent slots, at-least-once delivery, batching, and resume from retained WAL. The guidance: never use Realtime's Postgres Changes to maintain a durable copy of data in another system, because disconnects and restarts silently drop changes. Use Pipelines for that and Realtime for live user-facing updates, often both together.

  • Neon now has realtime

    Neon mediumAdept

    Neon Realtime, now in free public beta, turns any read-only deterministic SQL query (joins, aggregates, window functions, subqueries) into a live query whose result stays updated as data changes, running inside Postgres rather than as a separate realtime service. A TypeScript SDK lets backends define queries via raw SQL, Drizzle or Kysely and "seal" them so browsers or agents can subscribe safely, with React's useLiveQuery, optimistic writes confirmed via awaitTxId, SSR and TanStack DB support. Clients connect to Neon's ingress layer so subscriptions don't block scale-to-zero, incremental maintenance runs on a replica without consuming connections, and Realtime is enabled per branch. Beta limits include no row-level security, no published benchmarks, a changing protocol and four regions.

  • Making a Real-Time Chat App with Supabase on Replit

    Replit mediumAdept

    A real-time public chat app can be built with a Vue 3 and Tailwind CSS frontend on Replit backed by Supabase's hosted Postgres. The walkthrough creates a messages table via SQL, enables replication-based real-time events, and wraps the supabase-js client in a Vue composable. That composable handles paginated message loading by range, INSERT subscriptions for live updates, and inserts for sending. Users are identified only by a random username stored in localStorage, and older messages load when the list is scrolled to the top.

The quest for software engineering knowledge.

Look:
Layout: