Pushing Beats Polling Explained: Live Poll Trust Above a Handful of Viewers
Short answer: pushing beats polling above a handful of viewers because one state change should not trigger repeated reads for every screen, but treat delivery as an optimization, not as authorization. Scope every subscription token to one session, keep vote acceptance on a trusted server path, and retain a slow refresh route for recovery. Polling is operationally attractive at first because its…
The key takeaways from this source are:
1) Pushing beats polling when delivering poll results to viewers because polling creates unnecessary repeated reads that scale poorly with more viewers. Pushing delivers updates only when they actually happen, reducing unnecessary load.
2) The cost of polling comes from duplicated work - more viewers means more reads even when the result hasn't changed. Pushing avoids this by only pushing when the result actually changes, matching the application's actual workload.
3) Trust in the delivery system is critical. The client is untrusted and must be authenticated and authorized for each vote and session. Trust should be enforced at the server level, not simply by the transport layer.
4) Polling state should be kept small - only the poll ID, revision, status, totals and timestamp are necessary. Sensitive data like buyer/seller identity and raw ballots should be stored separately.
5) A snapshot-based approach where each push contains a newer revision of the public poll state is safer. Reconnecting clients should request a fresh authorized snapshot to establish a correct, up-to-date view.
6) Whether to use a managed delivery system or self-hosted solution depends on SLOs and operational constraints, not just aesthetic preferences. Both approaches still need to handle claim scope, authorization, and recovery.
In summary, pushing poll results rather than polling is more operationally efficient and aligns better with the actual workload. Trust must be established independently of the transport layer, and the system should keep poll state small while using immutable snapshots for reconnects. The choice of delivery mechanism should be guided by SLOs and operational constraints, not just the perceived benefits of a particular approach.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.