Home › Learn › Real-time analytics › Push to the screen
Real-time analytics · page 9 of 11
Push to the screen: snapshot first, then small changes
Push semantics for real-time dashboards: snapshot then changes, SSE vs WebSocket, where changes come from when the store cannot push, and gateways per cloud.
In plain words
Do not make the screen ask
With pull, the screen asks every few seconds: "anything new?". With push, the server tells the screen when something changes. Push gives fresher screens with less load, but only if the server sends small changes, not every raw event.
The pattern
Snapshot, then changes
- When the screen connects, send a snapshot: the current numbers.
- Then send only changes, throttled to about one per second per widget.
- On reconnect, send a fresh snapshot, so a dropped connection never leaves a wrong number on screen.
- Never forward raw events to the browser; the server works out what changed.
The channel
SSE or WebSocket?
| Channel | What it is | Use it when | Verdict |
|---|---|---|---|
| Server-Sent Events (SSE) | One-way updates from server to browser over plain HTTP; reconnects by itself | Dashboards and live boards | Pursue as the default |
| WebSocket | A two-way connection | The user also sends things back: filters that change the live query, collaboration | Pursue when you need two-way |
| GraphQL subscriptions | Push through a GraphQL API | You already serve GraphQL | Fine with a reason |
| Long-polling | The browser holds a request open until there is news | Only very old browsers or proxies | Drop |
Where changes come from
Most analytics stores do not push
- A results topic. The stream processor writes changed totals to a topic; the push gateway reads it. Works with any store.
- A streaming database subscription. Materialize SUBSCRIBE and RisingWave subscriptions push changed rows directly.
- Poll on the server, push the difference. ClickHouse, Pinot and Druid do not push by themselves. The gateway asks the store every second and sends the browser only what changed.
| Gateway | Azure | AWS | Open source and services |
|---|---|---|---|
| Push service | Azure SignalR, Azure Web PubSub | API Gateway WebSocket APIs, AppSync subscriptions | Socket.IO, a small Node or Go SSE service; Ably, Pusher |
BI tools such as Power BI do not push; their best is automatic page refresh. See which route for where they fit.
FAQ
Questions people ask
SSE or WebSocket for a real-time dashboard?
SSE for most dashboards: updates only flow one way, it runs over plain HTTP and reconnects by itself. Use WebSocket when the user also sends data back, such as filters that change a live query.
Does ClickHouse push changes to the browser?
No. Either a stream processor writes changes to a results topic that a gateway reads, or the gateway polls ClickHouse every second and pushes only the difference.
How often should a dashboard update?
About once a second per widget is plenty for people. Faster updates cost more and nobody can read them.
Next
Where to go next
Next page: What real-time analytics costs
↑ All of real-time analytics · Data platform architecture · Key concepts