Database / Supabase basics Interview Questions
Which is better for real-time collaboration, Supabase Realtime or client-side polling, and why?
Polling means the client repeatedly re-runs a query on an interval (say, every 3 seconds) to check for changes, while Supabase Realtime pushes a message over an already-open WebSocket the instant a matching row changes. For most collaborative use cases — shared cursors, live comments, presence indicators — Realtime is the better fit on nearly every axis: lower latency (changes appear in milliseconds rather than waiting for the next poll interval), lower database load (no repeated queries hitting Postgres from every connected client), and lower bandwidth (only actual changes are sent, not the full result set each time).
Polling still has a legitimate niche: it's simpler to reason about, doesn't require managing a persistent connection, and can be preferable for infrequent updates where sub-second latency doesn't matter, or in environments where WebSocket connections are unreliable (some restrictive corporate proxies, for instance). It also degrades more predictably under connection loss, since a client just tries again on the next interval rather than needing reconnection and resubscription logic.
In practice, most teams default to Realtime for anything genuinely collaborative and reserve polling for background, low-frequency checks like periodically refreshing a dashboard that doesn't need to feel live.
More Related questions...