Stage 1 of 9 · Model
What polling actually costs
Use the numbers in the scenario: 40,000 people online, five queries per screen, a poll every five seconds, 2,000 mutations a second.
What you need to know first
Polling and push put cost in different places:
- Polling costs (viewers × queries per screen ÷ interval), whether anything changed or not.
- Push costs (writes × queries each write affects), plus sending each new result to whoever watches it.
Which is cheaper depends on how often data changes compared with how often it's viewed. See Server push: polling, long polling, SSE, WebSockets.
40,000 people online, 5 queries per screen, polling every 5 seconds. How many query runs a second?
About 40,000 per second.
40,000 × 5 ÷ 5 = 40,000 runs a second, even if nothing changed.
To cut the delay to one second, polling every second. How many runs a second?
About 200,000 per second.
40,000 × 5 ÷ 1 = 200,000 a second: five times the load for a fifth of the delay. Polling is a dial between staleness and waste.
When is push dramatically cheaper than polling?
When data changes rarely relative to how often it's viewed, and the server can tell exactly which queries a write affects
Then most of polling's work re-reads unchanged data, and push only does work for real changes.
What the stage asks
Which statements follow?
- Holds
Polling costs about 40,000 query runs a second, whether or not anything changed.
40,000 people × 5 queries ÷ 5 seconds = 40,000 runs a second. The cost follows the number of viewers, not the amount of change.
- Holds
Most of those polls return exactly what the client already has.
2,000 writes a second, each touching one board or task, change a small fraction of the 200,000 live results in any five-second window. Most polls re-read data nobody touched.
- Holds
Polling every second instead would fix the delay without changing the architecture, at five times the load.
It would cut the delay to a second and cost 200,000 runs a second. It is a dial between staleness and waste, which is why polling stops scaling once both matter.
- Depends
With push, server work depends only on how many writes there are, not on how many people are watching.
Each write has to be matched against live subscriptions, and each affected query re-run and sent to its viewers. If a write affects one small board, that is cheap. If it affects a query thousands of people watch, sending the result is proportional to the audience, unless identical subscriptions share one run. That case comes later.
The reasoning
- Polling costs viewers × queries ÷ interval, whether or not anything changed.
- Push costs writes × affected queries, plus delivery to viewers.
- Push wins when change is rare relative to viewing, if affected queries can be found exactly.
Polling makes cost proportional to viewers × queries ÷ interval. Push makes it proportional to writes × the queries each write affects, plus sending results to the people watching them. When change is rare relative to viewing, push wins by orders of magnitude, but only if the server can tell cheaply and exactly which queries a write affects. That is the rest of this investigation.