Supabase and PostgresStorage, Edge Functions and Realtimereference
Supabase Realtime: filters, disconnect loss, Broadcast Replay and binary
Realtime has three modes (Postgres Changes, Broadcast, Presence); this page covers what a client of the first two observed when a documented behaviour was run: which Postgres Changes filters deliver what Postgres selects, what is lost when a socket drops, what Broadcast Replay returns, and whether binary Broadcast arrives as binary. It is for anyone building a subscriber, including the Durable Object relay in Cloudflare Workers + Supabase, which rests on the disconnect result below.
The existing coverage in this corpus is documented-only: the Realtime section of that page, the per-subscriber policy cost in RLS (row-level security) policy cost, and the global-cluster and realtime.messages partitioning rows in Data residency. This page adds measured rows and labels each one measured or documented.
All measured rows were run on 2026-10-10 on throwaway projects created on a Pro-plan organisation, region ap-southeast-1, default compute, no add-ons, each deleted by the module that created it. The vantage was a local macOS machine outside the project region. Every count is n=1 per row on one project unless the row says otherwise; none is a rate. The run log is RUNLOG.md and the published artifacts are in out/2026-10-10. The subscription-burst section is the exception: RT05 ran on 2026-10-22 (Small) and 2026-10-26 (2XL), two reps per burst row, and its rows carry their own provenance below. RT06 is the other exception: it ran on 2026-10-28 on three projects created at Small, Large and Small, with its provenance in Per-user feeds.
TL;DR:
- All 19 Postgres Changes filters tried (AND over two and three columns, two conditions on one column,
like/ilike,is,match/imatch,isdistinct,not.forms) delivered exactly the ids the equivalent SQL (Structured Query Language) predicate selects on the same 8 rows. selectalways adds the primary key, and an UPDATE that changes only an unselected column still produces an event.- A DELETE under a column filter delivered 0 of 2 matching DELETEs with replica identity
defaultand 2 of 2 withfull. A primary-key filter and an unfiltered subscriber received their DELETEs either way. - A
selector filter naming a column the subscribing role cannot read leaves the subscribe callback atSUBSCRIBEDand delivers 0 events. The only signal is a channelsystemevent. - A 30 s client-side gap with 25 rows inserted delivered 0 of 25 on rejoin. A heartbeat row, a 6 s staleness rule and a REST (representational state transfer) backfill recovered 40 of 40.
- Broadcast Replay returned at most 25 messages (the newest 25) with no error for a larger
limit; it refuses public channels and never holds client-sent messages. - Binary Broadcast arrived byte-for-byte on the current client over a WebSocket
ArrayBuffer,httpSend, raw REST andrealtime.send_binary; the old client received no binary event from any of them. AUint8Arrayover WebSocketsendarrived as a JSON (JavaScript Object Notation) object. - As the
postgresrole, writes torealtime.schema_migrationsanddrop trigger tr_check_filterswere accepted, against the changelog’s list. - A burst of 5000 Postgres Changes joins on Small gave 1421 and 1611 channels
Too many database timeoutswithpostgres_changes_poolas created, and none at 20; on 2XL the same burst joined 5000 of 5000 at both settings. Private Broadcast joined every channel on both sizes (RT05, 2026-10-22 and 2026-10-26, two reps). RT06 (2026-10-28) saw 0 to 1721 of 5000 joins time out per burst on two more Small projects and none on Large. - With nothing configured, the Postgres Changes pool held 4 connections on Small and 7 on XL (extra large) and 2XL, the concepts page’s table (the settings page says 2); the Authorization pool read 5 on XL and 2XL of a project resized from Small, where that table gives 10 (RT05, DC13).
- 5000 Postgres Changes subscribers on an RLS-protected table, one shared topic with an unfiltered INSERT binding against one topic per user with a
user_id=eq.<uid>filter:Too many database timeoutshit both shapes on one Small project (S2: 1620 and 1721), only shape B on the other (S1: 84 and 218, shape A 0 and 0), and neither on Large, and followed the project more than the shape. The filtered join took 13 to 26 per cent more database time per channel (RT06, 2026-10-28, five bursts per shape on three projects). - 20 rows inserted for 20 of those users reached their owners and no one else in both shapes, arriving together after 4583 to 5841 ms on Large and 6666 to 9851 ms on Small. Under the filter the Postgres Changes poll statement used 0.80 to 0.88 of the unfiltered shape’s time (RT06).
- Private per-user Broadcast from
realtime.send: therealtime.messagespolicy ran 5000 times for 5000 joins and 0 times across 2997 to 11999 sends per phase; delivery p50 12 to 17 ms, 0.09 to 0.24 ms of statement time and about 400 bytes ofrealtime.messagesper message (RT06).
Which do I pick
Section titled “Which do I pick”| What the subscriber must not miss | Primitive | First thing to check |
|---|---|---|
| Row changes across a gap | Postgres Changes, plus a heartbeat row and a REST backfill by updated_at | a 30 s client-side gap delivered 0 of 25 on rejoin, and 40 of 40 with the canary |
| DELETEs under a column filter | Postgres Changes with replica identity full, or a filter on the primary key | 0 of 2 filtered DELETEs under default and 2 of 2 under full |
| Messages sent while the client was away | Broadcast Replay: private channel, database-sent messages, limit 25 or less | limit 26 and 100 each returned 25 with no error |
| Byte payloads | Broadcast binary over httpSend, raw REST, realtime.send_binary or a WebSocket ArrayBuffer | the old client received no binary event from any of them, and JSON normally |
| Per-user events at thousands of subscribers | Private Broadcast on a per-user topic, sent with realtime.send | at 5000 subscribers the policy ran once per join and 0 times per message; 20 Postgres Changes rows arrived at p50 4583 to 5841 ms (Large) and 6666 to 9851 ms (Small) |
Each of these has a failure mode that shows as a healthy status: a channel that reports SUBSCRIBED and delivers 0 events, a limit silently capped, an upgrade that drops payloads without an error. The decision guide at the end of the page draws the same five choices.
What each question returned
Section titled “What each question returned”| Question | Measured answer (2026-10-10, n=1) | Section |
|---|---|---|
| Do the documented filter forms match SQL? | 19 of 19 delivered the oracle’s ids on 8 rows | Filters |
Does select change which events arrive? | No: an unselected-column UPDATE still arrives, trimmed | Select |
| Does a column filter see DELETEs? | 0 of 2 with identity default, 2 of 2 with full | DELETE |
| What happens on a revoked column? | SUBSCRIBED, 0 events, error only in the system event | Revoked column |
Is a new project ready at SUBSCRIBED? | First event arrived about 11 s later on 5 of 5 projects | First event |
| Does a rejoin replay the gap? | 0 of 25 rows after a 30 s gap | Disconnect loss |
| What does Replay return? | The newest 25 at most, private channels, database-sent only | Replay |
| Does binary Broadcast arrive as binary? | Yes on the current client for four of five send paths; no on the old client | Binary |
Is the realtime schema locked for postgres? | Six of ten operations refused, four accepted | Schema |
| When does a join burst time out? (2026-10-22 and 2026-10-26, two reps) | Small at 5000 joins with the pool as created; not on 2XL at 5000 | Bursts |
| Does one shared unfiltered topic measure per-user filtered joins? (2026-10-28, five bursts per shape) | No, it under-read them: the filtered join took 13 to 26 per cent more database time per channel; timeouts on Small in both shapes | Per-user feeds |
| What does private per-user Broadcast cost the database? (2026-10-28) | The policy once per join and 0 times per message; 0.09 to 0.24 ms of statement time per message | Per-user feeds |
Postgres Changes filters
Section titled “Postgres Changes filters”The Supabase blog (2026-08-05) says filters compose with a comma and “every condition has to match”, and adds like, ilike, is, match, imatch and isdistinct.1 The lab ran 19 filters, each on its own channel, against one INSERT batch of 8 rows in a table with RLS off, and compared each with select id ... where <equivalent SQL predicate> on the same rows. The anon role subscribed.
| Filter | Delivered of 8 | Note |
|---|---|---|
team=eq.a | 4 | |
team=eq.a,status=eq.open | 2 | AND over two columns |
team=eq.a,status=eq.open,flag=eq.true | 1 | AND over three columns |
n=gt.2,n=lt.6 | 3 | two conditions on one column |
team=in.(a,c) | 5 | |
email=like.a% | 1 | |
email=ilike.a% | 2 | |
note=is.null | 2 | |
flag=is.true | 3 | |
flag=is.false | 3 | |
email=match.^[a-d] | 4 | |
email=imatch.^[a-d] | 5 | one more than match |
note=isdistinct.active | 6 | includes the two rows where note is NULL |
status=not.eq.open | 3 | the NULL-status row is excluded, as in SQL |
email=not.like.a% | 6 | |
team=not.in.(a,b) | 1 | |
note=not.is.null | 6 | |
team=eq.a,status=not.eq.open | 2 | |
email=ilike.a%,flag=is.true | 2 |
All 19 delivered exactly the oracle’s ids, and an unfiltered control received 8 of 8. Not measured: OR (the blog describes AND only), the output of the postgresChangesFilter() builder, filters on other column types (timestamps, uuids, arrays), and a large batch.
Select and the primary key
Section titled “Select and the primary key”The blog says only the listed columns come back in the payload.1 One INSERT, a note-only UPDATE, a status UPDATE and one DELETE were sent to subscribers with different select lists:
select: ['status']delivered INSERT keysid,status;['id','team']and['status','email']likewise carriedidwithout it being listed.- The
note-only UPDATE still produced an UPDATE event for subscribers whoseselectexcludednote: 2 UPDATE events each,newtrimmed to the selected columns plusid,oldcarryingidonly. - DELETE events carried
old={id}and an emptynew, with and withoutselect. - The unselected control received all 8 columns on INSERT and UPDATE.
select: ['nope'], a column that does not exist: the subscribe callback reportedSUBSCRIBED, thesystemevent carriedstatus: errorwithinvalid column for select nope, and 0 events arrived.
A subscriber that narrows select to save payload bytes therefore still receives one event per change to the row.
DELETE under a column filter
Section titled “DELETE under a column filter”The blog states that “DELETE events only carry the row’s primary key, so column filters can’t be evaluated on deletes.”1 It does not mention replica identity. Four rows were seeded (2 with team a) and deleted:
| Subscriber | Replica identity default | Replica identity full |
|---|---|---|
team=eq.a, event * | 0 DELETE events | 2 of 2 |
team=eq.a,status=eq.open, event DELETE | 0 | 1 of 1 |
id=eq.<id> (primary key) | 1 | 1 |
| unfiltered, event DELETE | 4 | 4 |
Under full, old carried all 8 columns. The full-identity rows are the lab’s own finding, n=1; the WAL (write-ahead log) volume cost of alter table ... replica identity full was not measured. An UPDATE that moved a row out of team=eq.a produced no event for the team=eq.a subscriber, and the UPDATE that moved it back in produced 1 (new.team a).
A column the role cannot read
Section titled “A column the role cannot read”The blog requires that “the columns you list must be selectable by the subscribing role.”1 The setup revoked select on the table from authenticated and granted every column except secret. has_column_privilege('authenticated', ..., 'secret', 'select') was false, and PostgREST as that user answered 42501 permission denied for table for select=secret. With the user signed in on the client:
| Subscription | Subscribe status | Events | secret in payloads |
|---|---|---|---|
no select (all columns) | SUBSCRIBED | INSERT, both UPDATEs, DELETE | absent from every payload |
select: ['id','team'] | SUBSCRIBED | arrived normally | not selected |
select: ['id','secret'] | SUBSCRIBED | 0 | system event status: error ... invalid column for select secret |
filter: 'secret=eq.s' | SUBSCRIBED | 0 | system event invalid column for filter secret |
control: anon, table-level select intact, select: ['id','secret'] | SUBSCRIBED | 4 | present (s1, s1, s2) |
The documented requirement holds. The failure is not surfaced by the subscribe status callback and appears only in the system event, so a subscriber that checks SUBSCRIBED and nothing else sees a healthy channel that never delivers.
Delivered events with and without a filter
Section titled “Delivered events with and without a filter”Twenty INSERTs, 10 of them with team a: the unfiltered subscriber received 20, a team=eq.a subscriber 10, and team=eq.a with select: ['id'] 10. Billed message counts were not readable with a PAT (personal access token), and usage.api-counts total_realtime_requests read 7 before and 7 after the 20 events, so it does not count them. The claim that filtered events cost fewer messages rests on delivery counts only; that billing counts delivered events is the documentation’s statement and was not measured. Per-subscriber policy checks, which scale with the number of subscribers, are covered in RLS policy cost.
First event on a fresh project
Section titled “First event on a fresh project”On five fresh projects (RT01 three times, RT02 twice) the first change event reached the subscriber about 11 s after it subscribed. A canary INSERT was sent when the subscriber joined and another every 10 s. The values, in milliseconds, were 10655, 10635 and 10870 in RT01 and 10748 and 10790 in RT02.
On the three projects whose runs recorded which canary arrived, it was the second, sent about 10 s after the first, each time; the first canary’s event was not delivered. The two earlier runs did not record the index. On those three projects a subscribe that returned SUBSCRIBED was not proof that the change stream was wired. Lost versus late is not separated: the harness waited 1.5 s after the second canary’s event (sleep(1500) in lib/rt.ts, a code constant rather than a measured timing), and the first canary’s event had not arrived by then.
A readiness check for a new project, or a preview branch, needs an event round trip rather than a subscribe status.
Disconnect loss
Section titled “Disconnect loss”The client closed the socket with code 4000, so the server saw a clean close rather than a network partition.
| Run | Setup | Rows before / during / after | Received |
|---|---|---|---|
| RT02a | reconnectAfterMs fixed at 30 s, client reconnects itself | 3 / 25 / 3 | 3 of 3, 0 of 25, 3 of 3 |
| RT02b | manual disconnect(), then connect() after 30 s, 25 rows in between | gap 25, then 1 inserted after | original channel: 0 of 25 gap rows and the 1 later row; fresh channel on the same client: 0 of 25 |
In RT02a the status log read SUBSCRIBED, then CHANNEL_ERROR (4.7 s from the start), then SUBSCRIBED (34.7 s from the start), a rejoin delay after the drop of 30.1 s. None of the 25 gap rows was delivered at or after the rejoin. In RT02b the original channel was in state joined after connect() with no re-subscribe call.
Heartbeat-row canary
Section titled “Heartbeat-row canary”RT02c ran a recovery pattern. A second table’s single row is updated every 2 s (the heartbeat) and 40 data rows are written at 1 per second. At t=10 s the socket is dropped and does not reconnect on its own. The watcher declares the subscription stale after 6 s without a heartbeat event, tears the client down, subscribes a new one, then backfills updated_at > last_seen over REST and merges by id.
| Quantity | Measured |
|---|---|
| Rows in the table | 40 |
| Staleness declared | 4.8 s after the drop |
| New subscription joined in | 0.1 s |
| Backfill query returned in | under 0.1 s |
| Rows live on the first channel | 9 |
| Rows live on the second channel | 26 |
| Rows backfilled | 5 |
| Backfilled rows also seen live | 0 |
| Missing after the union | 0 of 40 |
The > boundary was not stressed. The rows had distinct now() values, so two rows committed with the same updated_at as last_seen is reasoned, not measured, as the case where > would drop a row. Not measured: a gap longer than 30 s, a server-side drop or a real network cut, and the blog’s “With 100 subscribers watching a table, one INSERT generates 100 authorization queries.”2
For a Durable Object relay that holds one upstream subscription, this is the reason a staleness watcher with a REST backfill belongs next to the subscription: the rejoin is automatic and delivers nothing from the gap. Broadcast Replay below is a separate feature for database-sent Broadcast messages and does not cover Postgres Changes rows.
Broadcast Replay
Section titled “Broadcast Replay”The Broadcast documentation says Replay “enables private channels to access messages that were sent earlier”, that limit must be a positive integer “with a maximum value of 25”, that only messages “published via Broadcast From the Database” are available, and that partitions older than 72 hours are dropped, so a message stays at least 72 hours and at most 4 days.3 The lab sent 26 messages with select realtime.send(jsonb_build_object('i', n), 'evt', topic, true) as separate autocommit statements, with policies allowing authenticated to select and insert on realtime.messages, and an authenticated user signed in on the client. Each row below used a fresh subscriber with since set before the first message.
| Subscription | Messages replayed | Ids (i) |
|---|---|---|
limit omitted | 25 | 2 to 26, ascending (message 1 not delivered) |
limit: 10 | 10 | 17 to 26 |
limit: 25 | 25 | |
limit: 26 | 25, no join error | |
limit: 100 | 25, no join error |
Every replayed message carried meta.replayed. A limit above the cap is clamped without an error, so a client that asks for 100 cannot tell from the join reply that 75 were withheld; it has to count.
sinceset to the floor of the epoch milliseconds of message 13’sinserted_at, and to that plus one millisecond, both withlimit: 25, gave 13 messages,i14 to 26. An unpublished iteration on a reused project returned 14 messages including 13 for the first value, so the boundary at sub-millisecond resolution is not settled.- Public channel: supabase-js refuses at construction (
tried to use replay on public channel). A raw WebSocket join withprivate: falseand a replay config receivedUnableToReplayMessages: Replay is not allowed for public channelsand 0 broadcast frames.realtime.send(..., private => false)still wrote 1 row torealtime.messages. - Client-sent messages: 3 by WebSocket
sendand 3 byhttpSendon a private topic were all acknowledged (ok,success: true), left 0 rows inrealtime.messagesfor the topic, and a later replay subscriber received 0. Replay covers database-sent messages only, as documented.
The first private use of a fresh project
Section titled “The first private use of a fresh project”Before the first Realtime connection realtime.messages was absent with 0 partitions on one project and present with 0 partitions on another. The first join answered after 187 and 171 milliseconds, and a partition for the current UTC (Coordinated Universal Time) day existed 5261 and 178 milliseconds later. In an earlier pass the same day on two other fresh projects, with no wait for the partition, realtime.send persisted 0 of 26 rows and the first private join answered CHANNEL_ERROR (MissingPartition: Realtime was unable to find the expected messages partition). The modules now wait for the partition. The partitioning is placed in the residency picture in Data residency.
Not measured: the 72-hour partition boundary, since older than the retention, and ordering when two messages share an inserted_at.
Binary Broadcast
Section titled “Binary Broadcast”The changelog of 2026-06-11 says Broadcast carries binary payloads from client libraries over WebSocket, over the REST API (application programming interface) and from the database, names minimum versions (supabase-js 2.91.0 for WebSocket, 2.107.0 for httpSend, Realtime server 2.103.2), and says binary sent to older clients is “silently dropped”.4 The lab used a private topic with select and insert policies and two receivers signed in as the same user, one on the current supabase-js and one on the old client pinned in the experiment directory. The payload was 16 bytes (00 01 02 03 7f 80 c8 fe ff 00 ff 00 10 20 40 80), plus a 4096-byte payload over WebSocket Uint8Array.
| Send path | Current receiver | Old receiver |
|---|---|---|
WebSocket send with an ArrayBuffer | 1 event, ArrayBuffer, bytes equal | 0 events |
WebSocket send with a Uint8Array (16 B and 4096 B) | 1 event, a JSON object keyed "0" to "15", not binary | the same JSON object |
httpSend with a Uint8Array | 1 event, ArrayBuffer, bytes equal | 0 events |
raw POST application/octet-stream | 1 event, ArrayBuffer, bytes equal | 0 events |
realtime.send_binary(bytea, ...) | 1 event, ArrayBuffer, bytes equal | 0 events |
JSON controls (WebSocket, httpSend, raw REST, realtime.send) | 1 event each, equal | 1 event each, equal |
- The old receiver saw nothing for binary, including no other event names. It joined and received JSON normally, which is the silent drop.
- A
Uint8Arraypassed to WebSocketsendon the current client arrived as a JSON-encoded object on both receivers, and only anArrayBufferwent binary.httpSendconverted aUint8Arraycorrectly. The old client sending aUint8Arrayby WebSocket orhttpSendalso produced the JSON-encoded object at the current receiver. The lab read the changelog as coveringArrayBufferandArrayBufferViewover WebSocket, so this differs from that reading; it was measured once, on one current client version. The 4096-byte row is theUint8Arraycase only; a 4096-byteArrayBufferwas not sent. The run log does not record a report filed upstream. - Stored form: a database send left rows with
extensionbroadcast,payloadnull and a 16-bytebinary_payload. - Private-channel policy applied to binary as to JSON. A topic with no select policy: the join answered
CHANNEL_ERROR (Unauthorized: You do not have permissions to read from this Channel topic: rt04:denied), and the anon key joining the policy-allowed topic got the same error. On a select-only topic the WebSocket binary and JSON sends by the authenticated user errored, raw REST binary and JSON with the user token answered 403, with the anon key 403, and a raw REST binary send with the secret API key answered 202 and the reader got the binary event. - Policies on
realtime.messagescombine with OR. A leftover permissivewith check (true)policy from an earlier module made the select-only topic writable in an unpublished iteration, and the module now drops every policy onrealtime.messagesfirst.
Not measured: client versions between the two used, so the changelog’s minimum versions are not located; the Realtime server version; binary on realtime.send_binary(..., private => false); an ArrayBuffer larger than 16 bytes over WebSocket; any size limit.
The realtime schema as postgres
Section titled “The realtime schema as postgres”The changelog of 2026-07-14 says the realtime schema is locked down: “creating, altering, or dropping objects fails with a permission error”, while RLS policies on realtime.messages keep working.5 The lab ran ten operations as the postgres role (is_superuser off) over the Management API query endpoint, with the session-mode pooler matching where tried. Each ran inside begin; ...; rollback; and was checked afterwards (89 rows in realtime.schema_migrations before and after, no probe row, messages.topic and realtime.topic() still present). Eight operations follow the changelog’s list as the lab read it; UPDATE and ALTER on realtime.schema_migrations are the probe’s own additions.
| Operation | Measured |
|---|---|
create table realtime.dd_probe; create function realtime.dd_fn | refused, 42501 permission denied for schema realtime |
alter table realtime.messages drop column topic; drop table realtime.messages; drop function realtime.topic() | refused, 42501 must be owner of table messages / must be owner of function realtime.topic |
alter table realtime.schema_migrations add column ... | refused, 42501 must be owner of table schema_migrations |
insert, update, delete on realtime.schema_migrations | allowed (201) on both vantages; the table ACL (access control list) gives postgres arwdDxtm, owner supabase_admin |
drop trigger tr_check_filters on realtime.subscription | allowed (201); the trigger existed before |
control: policy create, list, drop on realtime.messages | all succeed |
Six of ten were refused and four allowed. The refusal text for the messages and realtime.topic() operations differs from the permission denied for schema realtime the lab read in the changelog for the blocked operations. The lab also read the changelog as listing INSERT and DELETE on realtime.schema_migrations and the trigger drop as refused; on this project they were accepted. Two readings remain: the lockdown is delivered per Realtime service version and this project’s service was below 2.112.7 or had not applied it, or it covers only the other six operations. The service version was not read, the latest schema_migrations version was 20261002120000, and no persisted (not rolled-back) write was run, so the effect of an accepted write on Realtime is unmeasured. The run log does not record a report filed upstream for the difference. The wider set of platform lockdowns met by the postgres role is in Locking down Supabase.
Subscription bursts and Realtime’s connection pools (RT05)
Section titled “Subscription bursts and Realtime’s connection pools (RT05)”RT05 asked what a burst of joins does to Postgres Changes and to private Broadcast, against the settings page: “Postgres Changes connection pool size”, default 2, range 1 to 20, and “Too low: subscription creation times out during bursts. Clients receive a postgres_changes system error with Too many database timeouts and retry after 5 to 10 seconds.”6 It ran on 2026-10-22 on one Pro-org project in ap-southeast-1 resized to Small (max_connections 90, Postgres 17.11), and again on 2026-10-26 on a project resized Small -> XL -> 2XL (max_connections 380) that data-api-capacity DC13 and DC14 had used first, which left its Data API db_pool at 200. Two reps per burst row. The figures are from the RUNLOG and the artifacts run-2026-10-22T22-53-26-669Z (Small) and run-2026-10-26T01-21-52-456Z (2XL).
Shape of every burst: 10 Auth users in one tenant; a table rt05_items with a select policy for authenticated that checks membership through (select auth.uid()); an AFTER INSERT trigger calling realtime.send(..., private => true) on a tenant topic, with a realtime.messages select policy on the same membership. N WebSockets from one local process on the macOS machine (outside the project’s region), opened at 100 per second, one channel each, joined with a user token; then all N joins sent in one loop with no pacing. The client speaks the raw protocol and never rejoins or retries, so each outcome is the server’s first answer to one join. A Postgres Changes channel (pc) counts as ready on its system ok; a private Broadcast channel (bc) on the join reply. Fan-out is from one measured insert’s return to each channel’s receipt, on one clock; one process received every frame, so its own scheduling is inside those figures.
Size, postgres_changes_pool | Joins | pc ready, rep 1 / rep 2 | pc join to ready p50 / p95 ms | pc fan-out p50 / p95 / max ms |
|---|---|---|---|---|
| Small, null (as created) | 500 to 2000 | all, both reps | 825 / 1490 and 730 / 1380 at 1000 | 483 / 693 / 700 and 873 / 1294 / 1299 at 2000 |
| Small, null | 5000 | 3579 and 3389 of 5000; 1421 and 1611 got Too many database timeouts | 2964 / 5690 and 2864 / 5688 (ready channels) | 909 / 1338 / 1760 and 936 / 1352 / 1358 |
| Small, 1 | 2000 and 5000 | 1234 and 1202 of 2000, 3858 and 3829 of 5000 got the timeout; 1000 and below all ready | 2600 / 4872 and 2595 / 4937 at 1000 | - |
| Small, 20 | 5000 | 5000 and 5000 | 2038 / 3863 and 2028 / 3860 | 1286 / 1701 / 1709 and 1270 / 1457 / 1688 |
| 2XL, null | 2000 | 2000 and 2000 | 2051 / 2938 and 633 / 1192 | 612 / 825 / 836 and 628 / 840 / 1262 |
| 2XL, null | 5000 | 5000 and 5000 | 1607 / 3005 and 1571 / 2987 | 1041 / 1458 / 1465 and 1074 / 1480 / 1490 |
| 2XL, 20 | 5000 | 5000 and 5000 | 632 / 1192 and 641 / 1210 | 623 / 1029 / 1250 and 1289 / 2764 / 2828 |
Private Broadcast (bc, default configuration only) joined every channel at every level on both sizes. At 5000 joins its join to ready was 1730 / 3266 and 2067 / 3646 ms on Small and 639 / 1184 and 689 / 1318 ms on 2XL, and its fan-out p50 was 234 and 235 ms on Small and 46 ms in both reps on 2XL. At 100 joins on Small, Broadcast fanned out at p50 6 and 4 ms against 375 and 463 ms for Postgres Changes at the null default.
- The settings page’s failure appeared on Small at 5000 joins and at no lower level with the pool as created: 1421 and 1611 of 5000 channels got
{:error, "Too many database timeouts"}as their first answer, whilepostgres_changes_pool20 joined 5000 of 5000 in both reps. Whether a channel that got the timeout recovers through the documented retry was not measured; the client never retries. RT06 (2026-10-28) ran 5000 joins with the pool as created on two more projects, created Small rather than resized to it: its shared-topic shape got 0 and 0 timeouts on one and 1620 on the other, and its per-user filtered shape 84 and 218 on the first and 1721 on the second, so the count differs between Small projects (Per-user feeds). - On 2XL the 2000- and 5000-join bursts got no timeout at the null default: 2000 of 2000 and 5000 of 5000 in both reps, at both pool settings, with no join error and no rate-limit reply. The failure was not reached on 2XL, since nothing above 5000 was run. RT06’s project created Large got none in four 5000-join bursts either (2026-10-28).
- The only other failure class was the Small project’s first burst: 100 joins, 73 ready, 26
UnableToConnectToProjectand 1phx_error; the second rep joined 100 of 100. - Every ready channel of both kinds received the measured insert on Small (delivered equals ready on all 42 burst rows), and
pg_postmaster_start_timedid not change across any burst on either size.
Which connection is which pool
Section titled “Which connection is which pool”Realtime’s connections were sampled from pg_stat_activity once a second while each burst settled, all as supabase_admin. The ones named realtime_subscription_manager_pub followed postgres_changes_pool: they peaked at 1, 20, 21 and 81 with the setting at 1, 20, 21 and 100. That name tracking the setting is the basis for reading it as the Postgres Changes pool; it is not a documented mapping. With the setting null they peaked at 4 on Small (8 on the project’s first burst) and 7 on 2XL. RT06 (2026-10-28) read 4 in every 5000-join burst on projects created Small and Large.
The settings page gives that pool a default of 2.6 The concepts page’s table of default pool sizes gives “Subscription management” 4 for Small to Large and 7 for XL to 4XL,7 which is what was measured. The lab’s 2026-10-22 note that Small held 4 “where the docs give a default of 2” compared against the settings page; the RUNLOG corrected it on 2026-10-26 to cite the concepts table. data-api-capacity DC13 (2026-10-26) read the same per size on one project resized Small -> XL -> 2XL, with one 100-join burst at each:
| Size | realtime_subscription_manager_pub | Concepts table, Subscription management | realtime_connect | connection_pool read | Concepts table, Authorization Pool Size |
|---|---|---|---|---|---|
| Small | 4 | 4 | 5 | 5 | 5 |
| XL | 7 | 7 | 5 | 5 | 10 |
| 2XL | 7 | 7 | 5 | 5 | 10 |
realtime_subscription_manager, realtime_rls and realtime_replication_connection held 1 each at every size; before each burst only the 5 realtime_connect connections were open. The Authorization pool did not follow the size: the concepts table says 10 for XL to 4XL “If not specified”,7 and this project read connection_pool 5, an explicit value rather than null, on XL and 2XL, with 5 realtime_connect connections. DC16 (2026-10-26 05:48 UTC, after DC13 the same day) separated the two readings: a project created at 2XL read connection_pool 10 and held 10 realtime_connect, one created Small alongside read 5, so the Authorization pool comes from the size a project is created at and a resize keeps it, as a set Data API db_pool is kept across a resize (Data API capacity; DC16 RUNLOG). XL, 4XL and 8XL at creation were not run. That realtime_connect is the Authorization pool is inferred from it equalling connection_pool. The 2026-10-22 Small project read connection_pool 2 when created, and the DC13 project read 5 from the start, on Small. RT06’s three projects (2026-10-28), created Small, Large and Small with desired_instance_size, each read 5, the concepts table’s figure for both sizes.
Limits as configured
Section titled “Limits as configured”Both projects read max_concurrent_users 10000, max_joins_per_second 2500 and max_channels_per_client 100. The limits page’s Pro column says 500 concurrent connections and 500 joins per second; the values read match its “Pro (no spend cap)” and Team columns, and the organisation’s spend-cap state was not read.8 The Management API accepted postgres_changes_pool 21 and 100 (204, read back; its OpenAPI schema gives 1 to 100), past the settings page’s 20. With 100 on Small, realtime_subscription_manager_pub peaked at 81 during a 500-join burst, client backends afterwards were 90 of 90, and a Management API query answered 503 Failed to run sql query: FATAL: 53300: sorry, too many clients already.
Not measured: recovery of a channel that got the timeout, several channels per socket, filter= subscriptions, joins from more than one client address, a level that makes the null default time out on 2XL, explicit postgres_changes_pool values from 2 to 19, any connection_pool other than as created, and a project created at XL or 2XL.
Per-user feeds at 5000 subscribers (RT06)
Section titled “Per-user feeds at 5000 subscribers (RT06)”RT06 asked what a per-user notification feed costs at 5000 subscribers. Shape A puts every client on one shared public topic with an unfiltered INSERT binding on an RLS-protected notifications table, the shape a load test written against one topic produces; shape B gives each user its own channel with one INSERT binding filtered by user_id=eq.<uid>. RT06 ran both shapes, then private per-user Broadcast, to see whether shape A measures shape B’s join cost, what each costs per inserted row, and what Broadcast costs the database per message. The Postgres Changes page says “Postgres Changes authorizes every event against each subscriber”, that “Changes are also processed on a single thread to preserve their order, which means larger compute add-ons don’t meaningfully increase Postgres Changes throughput”, and that above about 3,000 concurrent subscribers on the same changes Broadcast should be used instead.9 The Realtime Authorization page says “Client access policies are cached for the duration of the connection. Your database is not queried for every Channel message.”10 Both pages were read on 2026-10-28.
It ran on 2026-10-28 on three projects in a Pro-plan organisation, region ap-southeast-1 as configured in the harness (not read back from the project), from the same local macOS machine. Each was created at its size with desired_instance_size and deleted by the module, not resized: S1 Small (max_connections 90, two reps per shape and per send rate), L Large (max_connections 160, two reps), S2 Small (one rep; run because S1’s node CPU (central processing unit) read -1 on every row). All three had the Realtime config as created: postgres_changes_pool null, connection_pool 5, max_concurrent_users 10000, max_joins_per_second 2500. 5000 users were inserted into auth.users with one SQL statement, and their access tokens minted locally as HS256 under the project’s legacy JWT (JSON Web Token) secret with sub the user id; on every project a minted token and a password-grant session token each joined a filtered binding and received their own row and not the other’s. The table rt06_notifications has RLS using (user_id = (select auth.uid())) for authenticated and an index on user_id. As in RT05: one WebSocket per user, one channel per socket, sockets opened at 100 per second, then all 5000 joins sent at once over the raw protocol, never retried. Shape A’s topic is rt06-shared for every client, shape B’s rt06-n:<uid> with filter user_id=eq.<uid>; both bind INSERT on public.rt06_notifications with private: false. Database cost is pg_stat_statements’ total_exec_time delta over a phase. The Realtime statements quoted are those outside the module’s own postgres sessions, all supabase_admin; the one exception is the send statement rt06_send_batch, which the module ran as postgres. The figures are from the RUNLOG and the artifacts run-2026-10-28T08-30-00-876Z (S1), run-2026-10-28T08-45-04-130Z (L) and run-2026-10-28T09-01-27-519Z (S2).
“Subscription statement” is the one supabase_admin statement that starts with candidates as ( select pub.schemaname, pub.tablename from pg_publication_tables pub ..., run once per ready channel.
| run, row | ready of 5000 | Too many database timeouts | join to ready p50 / p95 ms | first join to last settled ms | subscription statement calls / ms |
|---|---|---|---|---|---|
| S1 A r1 | 5000 | 0 | 2939 / 5591 | 5944 | 5000 / 5180 |
| S1 B r1 | 4916 | 84 | 3028 / 5706 | 6063 | 4916 / 5750 |
| S1 A r2 | 5000 | 0 | 2877 / 5391 | 5707 | 5000 / 4841 |
| S1 B r2 | 4782 | 218 | 3027 / 5690 | 6033 | 4782 / 5828 |
| S2 A r1 | 3380 | 1620 | 2964 / 5716 | 6269 | 3380 / 3856 |
| S2 B r1 | 3279 | 1721 | 3085 / 5703 | 6480 | 3279 / 4345 |
| L A r1 | 5000 | 0 | 2802 / 5285 | 5597 | 2471 + 2529 / 1537 + 1526 |
| L B r1 | 5000 | 0 | 2955 / 5550 | 5909 | 5000 / 3764 |
| L A r2 | 5000 | 0 | 2685 / 5227 | 5548 | 5000 / 3131 |
| L B r2 | 5000 | 0 | 2931 / 5496 | 5837 | 5000 / 3572 |
- The only failure class was
{:error, "Too many database timeouts"}, only on Small, in both shapes. It followed the project more than the shape: on S1 shape A had 0 and 0 and shape B 84 and 218; on S2 shape A had 1620 and shape B 1721. Large had none in four bursts. No row had a join error, a socket failure or a rate-limit reply, and 5000 of 5000 sockets opened every time. - The subscription statement’s call count equalled the ready count on every row, so a channel that got the timeout left no subscription statement behind (L A r1 split it over two query ids). Per ready channel (derived, ms over calls): shape A 0.97 and 1.04 ms against shape B 1.17 and 1.22 ms on S1, 1.14 against 1.33 ms on S2, 0.61 and 0.63 against 0.71 and 0.75 ms on L. The filtered binding’s join took 13 to 26 per cent more database time per channel than the unfiltered one in each project and rep pair, and join to ready p50 was 89 to 246 ms higher for shape B in each pair.
realtime.subscriptionheld one row per ready channel in both shapes: 1 distinctfiltersvalue under shape A, one per channel under shape B.realtime_subscription_manager_pubpeaked at 4 connections on every row, Small and Large.- Teardown, every socket closed until
realtime.subscriptionread 0, took 14197 to 18442 ms on S1, 16257 and 16364 ms on S2 and 4214 to 6177 ms on L.
As a stand-in for shape B, shape A under-read the join on every pair: less database time per channel and a lower join to ready p50. On S1 it got 0 timeouts in both reps where shape B got 84 and 218; on S2 both shapes got the timeout (1620 and 1721).
Delivery of 20 rows
Section titled “Delivery of 20 rows”After a canary row had reached its owner, 20 rows were inserted in one statement, one each for 20 ready clients spread over the fleet. “WAL statement” is the supabase_admin statement starting SELECT wal->>$5 as type, wal->>$6 as schema, ... (the Postgres Changes poll), with its pg_stat_statements delta over the delivery window. Latency is from the INSERT’s return on the local machine to arrival there.
| run, row | delivered to owner | misdelivered | latency p50 / p95 ms | WAL statement calls / ms |
|---|---|---|---|---|
| S1 A r1 | 20 of 20 | 0 | 9486 / 9490 | 7 / 9332 |
| S1 B r1 | 20 of 20 | 0 | 7966 / 7967 | 8 / 7862 |
| S1 A r2 | 20 of 20 | 0 | 9851 / 9853 | 8 / 9482 |
| S1 B r2 | 20 of 20 | 0 | 7839 / 7843 | 8 / 7599 |
| S2 A r1 | 20 of 20 | 0 | 7256 / 7259 | 7 / 7273 |
| S2 B r1 | 20 of 20 | 0 | 6666 / 6667 | 7 / 6418 |
| L A r1 | 20 of 20 | 0 | 5841 / 5843 | 8 / 5514 |
| L B r1 | 20 of 20 | 0 | 4796 / 4797 | 9 / 4409 |
| L A r2 | 20 of 20 | 0 | 5380 / 5383 | 8 / 5414 |
| L B r2 | 20 of 20 | 0 | 4583 / 4592 | 8 / 4380 |
- Both shapes delivered each row to its owner and to no one else: 20 clients received a row, 0 duplicates, 0 channel errors after ready. Under shape A the RLS policy did the per-user selection, since every client held an unfiltered binding on the same table.
- The 20 rows arrived together, p50 and p95 within 9 ms of each other.
- The WAL statement’s time covers the 20 rows plus that window’s empty polls. Shape B’s was 0.80 to 0.88 of shape A’s in each project and rep pair (derived). The RUNLOG’s inference, not separated by this run: the per-row cost scales with the 5000 subscriptions in both shapes, and the
user_id=eqfilter trims it by 12 to 20 per cent instead of reducing it to the one matching subscriber. The run does not show where inside the statement the filter is applied. - Node CPU (coarse; the metrics snapshot moved about once a minute and the figure includes socket opening, delivery and teardown): L shape A 12.6 and 12.4 per cent, shape B 6.8 and 8.6; S2 shape A 14.8, shape B 12.7. S1’s was not read.
Against the Postgres Changes page: the 20 rows reached their owners at p50 4583 to 5841 ms on Large against 6666 to 9851 ms on Small. That is the latency of one 20-row batch per burst; sustained throughput was not run, so it neither confirms nor contradicts the page’s statement that larger compute does not raise throughput. RT06 ran 5000 subscribers with RLS on, above the page’s figure of about 3,000 concurrent subscribers for switching to Broadcast and above the largest RLS rows in its estimator tables (3,000 connected clients for Small to medium, 4,000 for Large to 16XL).9 Those rows are sustained rates, so their latencies are not compared here.
Against RT05: RT05’s one measured insert reached every ready channel at 5000 joins with fan-out p50 909 and 936 ms on Small and 1041 and 1074 ms on 2XL, lower than RT06’s 20-row delivery p50 on every row. The shapes differ (RT05: one row readable by all 10 users of one tenant; RT06: 20 rows, each readable by one of 5000 users), and the run did not separate which difference produces the gap. Reasoned, not measured: if each row is checked against every subscription on the table, 20 rows cost the poll 20 checks per subscription where RT05’s one row cost one.
Private per-user Broadcast
Section titled “Private per-user Broadcast”5000 private channels, topic user:<uid>, one per user. The realtime.messages select policy for authenticated was extension = 'broadcast' and (select realtime.topic()) = 'user:' || (select auth.uid())::text and public.rt06_policy_hit(), the last a volatile function that calls nextval on a sequence, which is not rolled back with the transaction that checks the policy, so the sequence counts policy evaluations. Sends: public.rt06_send_batch(jsonb), a plpgsql loop calling realtime.send(payload, 'note', 'user:<uid>', true) per message, issued every 50 ms with that tick’s messages on up to 4 pooler sessions, each message to the next ready user in turn, for 60 s.
| run | ready of 5000 | join to ready p50 / p95 ms | policy evaluations during joins | realtime.authorize statement calls / ms |
|---|---|---|---|---|
| S1 | 5000 | 905 / 1683 | 5000 | 5000 / 2363 |
| L | 5000 | 648 / 1220 | 5000 | 5000 / 1612 |
| S2 | 5000 | 981 / 1825 | 5000 | 5000 / 2395 |
| run, rate, rep | sent | delivered to the intended client | latency p50 / p95 / max ms | send statement ms per message | policy evaluations during sends |
|---|---|---|---|---|---|
| S1 50/s r1 | 2998 | 2998 | 14 / 20 / 357 | 0.193 | 0 |
| S1 200/s r1 | 11990 | 11990 | 16 / 23 / 306 | 0.134 | 0 |
| S1 50/s r2 | 2999 | 2999 | 14 / 20 / 229 | 0.2 | 0 |
| S1 200/s r2 | 11999 | 11999 | 16 / 21 / 515 | 0.142 | 0 |
| S2 50/s r1 | 2997 | 2997 | 14 / 19 / 337 | 0.24 | 0 |
| S2 200/s r1 | 11995 | 11995 | 17 / 22 / 242 | 0.161 | 0 |
| L 50/s r1 | 2999 | 2999 | 13 / 18 / 374 | 0.148 | 0 |
| L 200/s r1 | 11998 | 11998 | 14 / 19 / 481 | 0.09 | 0 |
| L 50/s r2 | 2999 | 2999 | 12 / 17 / 91 | 0.147 | 0 |
| L 200/s r2 | 11994 | 11994 | 14 / 20 / 349 | 0.091 | 0 |
- The policy ran once per join and not per message: 5000 policy evaluations for 5000 joins on every project, one
realtime.authorizecall per join (0.32 to 0.48 ms each, derived), and 0 evaluations during each of the ten send phases. This agrees with the Realtime Authorization page.10 The settings page also lists eachaccess_tokenrefresh and each private Broadcast REST request as uses of the Authorization pool;6 RT06 sent from the database and ran no token refresh, so neither was measured. - Every message reached its user’s channel and no other; no send error, channel error or close. Latency is from the batch being issued on the local machine to arrival there, so it includes the pooler round trip.
- Database cost per message is the send statement’s pg_stat_statements time divided by messages. It fell at 200 per second, where each statement carried about four times as many messages; a statement per message, or a trigger per row, was not run, so the per-message figure for those is unmeasured. The
supabase_adminstatement time in the same windows was the Postgres Changes poll (127 to 130 calls per phase), not per message. realtime.messagesgrew by one row per message: S1 1146880 to 13246464 bytes over 5 partitions across its four phases, L 1155072 to 13205504, about 404 and 402 bytes per row for a payload of a key and a timestamp (derived). Partition retention is the Broadcast documentation’s 72 hours to 4 days3 and was not measured.- Node CPU (coarse): L 2.7, 3.7, 3.3 and 2.4 per cent; S2 4.6 and 2.6 per cent. They do not rise with the send rate; at this resolution the sends are not separable from the idle baseline.
Not measured: a permissive policy under shape A (every client receiving every row), a postgres_changes_pool other than as created, what a timed-out client does next, more than one client address, Realtime’s own CPU, a statement or trigger per message, payloads above a few dozen bytes, and sizes other than Small and Large.
Reading the numbers
Section titled “Reading the numbers”- Every row is one run on one project. The 19-filter result, the delivery counts and the byte-for-byte binary equality are the kind of finding one run supports, because a mismatch would show on the first run. The 0 of 25 rejoin result and the 11 s first-event delay would need repeats to put a spread on them; the delay was seen on 5 of 5 projects.
- The disconnect was a client-initiated close with code 4000, so the server saw a clean close. A real network cut, a server-side drop and a gap longer than 30 s were not run, and the 0 of 25 does not extend to them.
- The vantage was a local machine outside
ap-southeast-1. Timings (4.8 s to staleness, 0.1 s to rejoin, 11 s to first event) include that path. - Client versions are the current
@supabase/supabase-jsat run time (its version is in the RT01a row of the artifact) and one older pinned client. Behaviour between those versions, and on other SDKs (software development kits), was not run. - The Realtime service version was not read on any project, so every service-side row is tied to the service as it ran on 2026-10-10 and may change with a release.
- Billing and retention claims remain documented-only: billed message counts and the 72-hour partition boundary.
- RT05 is two reps per burst row on one project per size, from one local process on one client address. Its join and fan-out times include that process’s own scheduling at 5000 sockets, and the 2XL project was resized to 2XL rather than created there, after other modules had used it.
- RT06 is five bursts per shape and five send phases per rate (ten in all) over three projects created at their size on one day (two Small, one Large), from one local process on one client address. Its database figures are pg_stat_statements time over a phase, for
supabase_adminstatements except the send statement, which ran aspostgres; its node CPU is coarse and was not read on S1. The 20-row delivery is one batch per burst, so it is a latency and not a throughput. The Broadcast sends were batched per 50 ms tick, and their latency includes the pooler round trip.
Evidence
Section titled “Evidence”| Claim | Status | How it was checked |
|---|---|---|
| 19 filters delivered the SQL oracle’s ids on 8 rows | Measured 2026-10-10 | RT01, RT01b rows |
select adds the primary key; an unselected-column UPDATE still fires | Measured 2026-10-10 | RT01, RT01c rows |
| DELETE under a column filter: 0 of 2 (default), 2 of 2 (full) | Measured 2026-10-10 | RT01, RT01d rows |
Revoked column: SUBSCRIBED, 0 events, system event error | Measured 2026-10-10, corrected client | RT01, RT01e rows |
| First event about 11 s after subscribe on 5 of 5 projects | Measured 2026-10-10 | RT01a (three projects), RT02 setup (two) |
| 0 of 25 after a 30 s client-side gap; 40 of 40 with the canary | Measured 2026-10-10, clean close | RT02a, RT02b, RT02c |
Replay cap, limit, public refusal, client-sent not persisted | Measured 2026-10-10 | RT03, RT03b to RT03e |
| Binary arrival by send path and client; policy on binary | Measured 2026-10-10 | RT04, RT04a to RT04d |
Realtime schema operations as postgres | Measured 2026-10-10 | DD03 |
Replay limit maximum 25, private channels only, 72 h to 4 days retention | Documented, page read 2026-10-10 | Broadcast documentation3; the cap and private rule measured above, retention not |
| Binary minimum versions, silent drop on old clients | Documented, page read 2026-10-10 | Changelog4; the silent drop measured above, versions not located |
| 100 subscribers, one INSERT, 100 authorisation queries | Documented, not counted; RT06’s poll statement time under a filter (0.80 to 0.88 of unfiltered at 5000) fits it, inferred | Blog2 and the Postgres Changes page9 |
Join bursts: Small 1421 and 1611 of 5000 timed out at the pool as created, 0 at postgres_changes_pool 20; 2XL 0 at both | Measured 2026-10-22 and 2026-10-26, two reps | RT05, RT05b and RT05c rows; Small facts, 2XL facts |
Postgres Changes pool 4 (Small), 7 (XL, 2XL); Authorization pool 5 on Small, XL and 2XL of the DC13 project (2026-10-26; the 2026-10-22 Small project read connection_pool 2) | Measured 2026-10-22 and 2026-10-26 | pg_stat_activity by application_name during bursts (RT05) and per size (data-api-capacity DC13); the name-to-pool mapping is inferred |
postgres_changes_pool 21 and 100 accepted; 100 filled max_connections on Small | Measured 2026-10-22, one rep each | RT05, RT05a-bound100-conns |
Default pool sizes per compute, postgres_changes_pool default 2 and range 1 to 20, Pro limits 500 / 500 | Documented, pages read 2026-10-26; concepts and settings re-read 2026-10-28, unchanged | Concepts,7 settings6 and limits8 pages |
5000 joins, shape A (shared, unfiltered) and B (per user, user_id=eq): timeouts on Small in both (S1 A 0 and 0, B 84 and 218; S2 A 1620, B 1721), none on Large; shape B 13 to 26 per cent more subscription statement time per channel | Measured 2026-10-28, five bursts per shape on three projects | RT06, RT06b rows; S1 facts, L facts, S2 facts |
| 20 rows to their owners only in both shapes, 4583 to 9851 ms p50; poll statement 0.80 to 0.88 of shape A’s under the filter | Measured 2026-10-28; the per-row scaling with subscriptions is inferred | RT06, RT06b rows |
Private per-user Broadcast: policy 5000 times for 5000 joins and 0 during sends; 0.09 to 0.24 ms statement time per message; about 400 bytes per realtime.messages row | Measured 2026-10-28, ten send phases on three projects | RT06, RT06c-join and RT06c send rows |
| Postgres Changes authorises every event per subscriber and processes changes on a single thread, so larger compute does not meaningfully raise its throughput; Broadcast above about 3,000 subscribers; Broadcast policies cached per connection | Documented, pages read 2026-10-28; throughput not measured | Postgres Changes9 and Realtime Authorization10 pages |
| OR filters, billed message counts, real network cut | Not measured |
What to do about it
Section titled “What to do about it”| Practice | Evidence | Module |
|---|---|---|
| Check a new filter operator against the same predicate in SQL on a sample batch. | 19 of 19 filters matched the oracle on 8 rows; OR was not run. | RT01 |
Set replica identity full on tables whose DELETEs a column filter must receive. | Column filter 0 of 2 DELETEs under default, 2 of 2 under full; WAL cost unmeasured. | RT01 |
| Filter DELETE subscriptions on the primary key or subscribe unfiltered. | Primary-key filter got its 1 and the unfiltered subscriber all 4 under default. | RT01 |
Listen for the channel system event, not only the subscribe status. | SUBSCRIBED with 0 events and invalid column for select secret on a revoked column. | RT01 |
Keep select and filter columns to ones the subscribing role can read. | Filter on a revoked column: invalid column for filter secret, 0 events. | RT01 |
| Wait for an event round trip before treating a new project’s stream as wired. | First event about 11 s after subscribe on 5 of 5 projects; first canary undelivered on 3 of 3 that recorded it. | RT01 |
| Run a heartbeat row and a REST backfill beside every long-lived subscription. | Gap 0 of 25 on rejoin; canary stale in 4.8 s, 40 of 40 recovered, 0 duplicated. | RT02 |
Backfill with an overlap on updated_at and merge by id. | The > boundary was reasoned, not measured: equal updated_at values would be dropped. | RT02 |
Use Replay on private channels with database-sent messages and limit of 25 or less. | limit 26 and 100 returned 25 with no error; public refused; client-sent not stored. | RT03 |
On a new project, join once and wait for the day’s partition before realtime.send. | 0 of 26 persisted and MissingPartition with no wait for the partition. | RT03 |
Send binary by httpSend, raw REST, send_binary or a WebSocket ArrayBuffer. | Four paths arrived byte-for-byte on the current client; a WebSocket Uint8Array arrived as JSON. | RT04 |
| Upgrade every receiver before sending binary. | The old client got 0 events and no error for binary, and JSON normally. | RT04 |
Raise postgres_changes_pool on Small before a reconnect storm of thousands of joins. | 5000 joins: 1421 and 1611 timed out at the pool as created, 0 at 20; at 1, timeouts from 2000. Recovery through the documented retry not measured. RT06: 0 to 1721 per burst on two more Small projects, none on Large; 20 not run there. | RT05, RT06 |
Keep postgres_changes_pool at 20 or below. | 21 and 100 were accepted; at 100 on Small the pool reached 81 connections and Postgres refused new clients (53300). | RT05 |
Read Realtime’s pools in pg_stat_activity after a resize; do not assume the table. | On a project resized from Small, connection_pool and realtime_connect stayed 5 on XL and 2XL, where the concepts table gives 10. | DC13, RT05 |
| Prefer private Broadcast from a trigger for fan-out to thousands of subscribers. | Broadcast joined every channel at 5000 on both sizes and fanned out at p50 234 and 235 ms (Small) and 46 ms (2XL), against 623 to 1289 ms for Postgres Changes. | RT05 |
Load-test per-user channels with their user_id=eq filter, not one shared topic. | Shape B’s join took 13 to 26 per cent more database time per channel and p50 89 to 246 ms longer; on S1 shape A got 0 timeouts where B got 84 and 218. | RT06 |
| Repeat a Small join burst on more than one project before reading a margin from it. | 5000 joins, pool as created: shape A 0 and 0 timeouts on S1, 1620 on S2; RT05’s Small project 1421 and 1611. | RT05, RT06 |
| Count every subscription on a table in its per-row cost, filtered or not. | Poll statement time under user_id=eq was 0.80 to 0.88 of unfiltered at 5000 subscriptions; the scaling is inferred, not separated. | RT06 |
| Keep Postgres Changes off paths that need sub-second delivery at 5000 subscribers. | 20 rows arrived after p50 4583 to 5841 ms (Large) and 6666 to 9851 ms (Small); one batch per burst, throughput not run. RT05’s Small fan-out at 5000 joins was 909 and 936 ms (one row, 3579 and 3389 ready). | RT05, RT06 |
Send per-user feeds as private Broadcast on a per-user topic with realtime.send. | 5000 of 5000 joined on all three projects, every message reached its user only, p50 12 to 17 ms. | RT06 |
Budget realtime.messages policy cost per join and token refresh, not per message. | 5000 evaluations for 5000 joins, 0 across 2997 to 11999 sends per phase; token refresh is documented, not run. | RT06 |
| Send several messages per statement where the sender can batch them. | 0.193 and 0.2 ms per message at 50/s, 0.134 and 0.142 at 200/s (S1), about four times the messages per statement; read as batching, not separated; a statement per message not run. | RT06 |
Size realtime.messages at about 400 bytes per database-sent message. | One row per message; S1 1146880 to 13246464 bytes, about 404 bytes per row for a key and a timestamp (derived). | RT06 |
Leave realtime.schema_migrations and tr_check_filters alone. | Writes and the trigger drop were accepted against the changelog; effect on Realtime unmeasured. | DD03 |
Decision guide
Section titled “Decision guide”- Row changes where gaps matter: run a heartbeat row and a REST backfill by
updated_at. - Row changes filtered by a column that must also see DELETEs: set replica identity
full, or filter on the primary key. - Broadcast catch-up after a gap: Replay on a private channel, database-sent messages,
limitof 25 or less. - Broadcast byte payloads:
httpSend, raw REST,realtime.send_binaryor a WebSocketArrayBuffer, to receivers on a current client. - Events for each user at thousands of subscribers: private Broadcast on a per-user topic, sent with
realtime.send(measured from a batching function; a trigger per row was not run).
Modules
Section titled “Modules”| Module | Experiment | Test | Artifact |
|---|---|---|---|
| RT01 | realtime-surface | rt01-postgres-changes-filters.ts | out/2026-10-10 |
| RT02 | realtime-surface | RT02 test, tests/ directory | out/2026-10-10 |
| RT03 | realtime-surface | rt03-broadcast-replay.ts | out/2026-10-10 |
| RT04 | realtime-surface | rt04-binary-broadcast.ts | out/2026-10-10 |
| RT05 | realtime-surface | rt05-subscription-burst.ts | run-2026-10-22T22-53-26-669Z, run-2026-10-26T01-21-52-456Z |
| RT06 | realtime-surface | rt06-filter-and-user-broadcast.ts | out/2026-10-28 |
| DC13 | data-api-capacity | dc13-tier-defaults.ts | run-2026-10-26T00-24-26-283Z |
| DD03 | data-api-defaults | dd03-platform-lockdowns.ts | run-2026-10-09T23-58-24-538Z, run-2026-10-10T00-00-27-688Z |
Related docs
Section titled “Related docs”- Cloudflare Workers + Supabase: an architecture reference - the Durable Object relay whose upstream rejoin delivers 0 of 25.
- RLS policy cost - the per-subscriber policy check that a filtered subscription still pays.
- Data residency - the global cluster and the
realtime.messagespartitioning. - Locking down Supabase - the other platform lockdowns met by the
postgresrole.
References
Section titled “References”-
Supabase, “Postgres Changes gets AND filters, new operators, and column selection,” Supabase Blog, 2026-08-05. https://supabase.com/blog/postgres-changes-filters-and-column-selection ↩ ↩2 ↩3 ↩4
-
Supabase, “Realtime or Pipelines? How to choose the right tool,” Supabase Blog, 2026-05-05. https://supabase.com/blog/realtime-or-pipelines-how-to-choose-the-right-tool ↩ ↩2
-
Supabase, “Broadcast,” Supabase Docs. https://supabase.com/docs/guides/realtime/broadcast ↩ ↩2 ↩3
-
Supabase, “Realtime Broadcast now supports binary payloads,” Supabase Changelog, 2026-06-11. https://supabase.com/changelog/46834-realtime-broadcast-now-supports-binary-payloads ↩ ↩2
-
Supabase, “Realtime schema is now fully locked down against modifications,” Supabase Changelog, 2026-07-14. https://supabase.com/changelog/realtime-schema-locked-down-against-modification ↩
-
Supabase, “Realtime: Settings,” Supabase Docs. https://supabase.com/docs/guides/realtime/settings ↩ ↩2 ↩3 ↩4
-
Supabase, “Realtime Concepts,” Supabase Docs. https://supabase.com/docs/guides/realtime/concepts ↩ ↩2 ↩3
-
Supabase, “Realtime Limits,” Supabase Docs. https://supabase.com/docs/guides/realtime/limits ↩ ↩2
-
Supabase, “Postgres Changes,” Supabase Docs. https://supabase.com/docs/guides/realtime/postgres-changes ↩ ↩2 ↩3 ↩4
-
Supabase, “Realtime Authorization,” Supabase Docs. https://supabase.com/docs/guides/realtime/authorization ↩ ↩2 ↩3