Realtime Features: Live Updates Explained
Live cursors, chat messages that appear instantly and "3 people viewing" all run on an open connection. Here is how realtime works and which kind your feature needs.

Key takeaways
- Realtime means the server pushes changes to open apps over a held-open connection (usually a WebSocket), instead of each app asking again and again.
- Three building blocks cover most features: database change feeds, broadcast messages and presence (who is online).
- The database stays the source of truth. Live updates make the screen current; they do not replace saving.
Realtime features are the parts of an app that update on their own the moment something changes: a chat message appears without refreshing, a shared to-do list ticks off when your partner taps it, a dashboard counter climbs as orders arrive. They work by keeping a connection open between each app and the server (usually a WebSocket) so the server can push changes the instant they happen, instead of waiting for the app to ask.
Asking repeatedly vs being told
Normal web requests work like checking your mailbox: the app asks "anything new?" and the server answers. The simple way to fake live updates is polling, asking every few seconds. It works, and for a dashboard that refreshes every minute it is perfectly fine. But it is wasteful (most answers are "nothing new") and laggy (up to a full interval behind).
Realtime flips it into a phone call. The app opens a connection once and keeps it open. When something changes, the server speaks; the update lands in well under a second on a decent connection. One open connection per user is cheap compared with thousands of repeated questions.
The three building blocks
Most realtime platforms, including Supabase Realtime, offer the same three tools. Knowing which one a feature needs is most of the design work.
- Database changes: "tell me when a row in `messages` is inserted for room 42". The data is saved first, then every subscriber hears about it. Use it for things that must persist: chat messages, comments, order statuses, task changes.
- Broadcast: send a message to everyone in a channel without saving it. Use it for things that are fleeting: cursor positions, "someone is typing", a reaction emoji floating up, a game piece being dragged.
- Presence: track who is connected to a channel right now and share a little state about each (name, color, current page). Use it for online dots, "3 people viewing", and lobby lists.
A chat room, step by step
- 01Ana opens room 42. Her app loads the last 50 messages with a normal request, then subscribes to new inserts in `messages` where `room_id` is 42, and joins the room's presence.
- 02Ben is already there; Ana's app receives the presence list and shows "Ben is online".
- 03Ben starts typing. His app broadcasts "Ben is typing" (not saved). Ana sees the dots.
- 04Ben sends "Running 5 minutes late". His app inserts a row in `messages`. Row level security confirms Ben belongs to room 42.
- 05The database change reaches every subscriber allowed to see that row. Ana's screen shows the message instantly.
- 06Ana's phone loses signal in a tunnel. When it reconnects, the app reloads messages since the last one it has, so nothing is missed.
Step 6 is the one people forget. Live feeds tell you what changed while you were connected. They do not replay what you missed, so every realtime screen needs a "catch up on reconnect" step.
Features that run on realtime
- Collaboration: shared lists, whiteboards, documents, live cursors.
- Communication: chat, comments, notifications that pop up in an open tab.
- Operations: a kitchen screen showing new orders, a delivery status moving from "preparing" to "on the way", a support queue.
- Events and classrooms: live polls, quizzes, auctions, Q&A boards that reorder by votes.
- Games: lobbies, turn-based moves, scoreboards. Fast action games are a special case; see below.
Pitfalls to plan for
- Security applies to live data too. A change feed must respect the same rules as normal reads, or users will receive rows they should not see. With Supabase, database change events respect row level security for the subscribing user.
- Conflicting edits. Two people rename the same task at once. Decide the rule: last write wins, or lock while editing, or merge. For most apps, last write wins plus a visible "edited by Ben just now" is enough.
- Too many updates. A cursor moving at 60 frames a second will flood a channel. Throttle broadcasts to a handful per second.
- Connection limits and cost. Each open app holds a connection. Plans have limits on concurrent connections and messages, so check them before a launch that might bring a crowd.
- Battery and data on phones. Unsubscribe from channels when a screen closes.
Making it feel instant
Even a fast round trip takes a moment, and on a weak phone signal it can take a second or more. Two techniques make realtime apps feel snappy anyway:
- Optimistic updates: when you tick a task, the screen shows it ticked immediately, before the server confirms. If the save fails, the app quietly undoes it and shows a short message. Most of the time the user never waits.
- Honest connection status: a small "Reconnecting..." label when the connection drops tells people why updates paused, instead of letting them assume the app is broken.
Pair them with the catch-up step from the chat example, and the app stays correct even when the network is not. A good rule of thumb: the screen may run slightly ahead of the server for a moment, but it must always end up agreeing with the database.
Why fast action games are different
Change feeds and broadcast are excellent for lobbies, turns and shared boards. A fast action game, where many players move every frame and the server must decide who hit whom, usually needs a dedicated game server that holds the match in memory and runs the rules many times a second. On Startbase, live sync for lobbies, presence, turns and live boards runs on your backend's realtime channels and is included. Room servers give action games one isolated server per match; previews run them on every plan, and publishing a game with its room server needs a paid plan. See the multiplayer docs and our guide to building a multiplayer game.
Asking for realtime in Startbase
Realtime needs a backend, so enable Startbase Cloud first (the agent asks in chat when a feature needs one). Then describe what should be live, what should persist, and who may see it:
Make the kitchen screen for my restaurant ordering app live. New orders should appear within a second of being placed, newest at the bottom, with a soft chime. When a cook taps "Ready", the order turns green for everyone and the customer's order page updates to "Ready for pickup" without refreshing. Show which kitchen tablets are online. If a tablet reconnects, it should reload any orders it missed.
Test with two browser windows side by side, then turn the network off on one for 30 seconds and back on. If the screens agree afterward, your realtime is solid. The rules that keep live data private are the same ones in row-level security explained.
Frequently asked questions
What is a WebSocket?
A connection between an app and a server that stays open, so either side can send messages at any time. It is the usual technology behind chat, live dashboards and multiplayer lobbies on the web.
Is polling ever good enough?
Yes. If data changes rarely or a delay of 30 to 60 seconds is fine, such as a reporting dashboard, polling is simpler and perfectly acceptable.
Do realtime updates replace saving to the database?
No. Anything that must survive a refresh should be saved to the database. Realtime then tells everyone about the change. Only fleeting signals like typing indicators skip the database.
Can realtime work on mobile apps?
Yes. Mobile apps hold the same kind of connection while open. Close subscriptions when screens close, and catch up on missed changes when the app comes back to the foreground.

