Urgent.News

What's breaking now, across thousands of outlets.

Tech

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.

Read the original at dev.to →

More in Tech

Why we stopped retrying on timeout and built reconciliation instead

Early in StareBrain’s action dispatch layer, we had a simple rule: if an action times out, retry it. It felt safe. It felt standard. It was wrong. The problem isn’t the retry.

  • StareBrain's previous rule was to retry actions on timeout, which proved incorrect.
  • New state model tracks Delivery and Acceptance states independently to reconcile ambiguous actions.

How to preview a coding benchmark run before spending on model calls

Use the --dry-run option to inspect a benchmark plan before launching model calls. In Weave Router's public weave-bench harness, the option resolves the pinned task manifest and prints the Harbor…

  • Use --dry-run option to preview benchmark plan without network impact.
  • --smoke selects smaller task set but may initiate jobs and incur costs.
  • Verify task selection, pinned versions, and comparison arms before removing --dry-run flag.

Building a Trading Engine in Java: Beyond BUY and SELL Signals

Generating a BUY or SELL signal is relatively straightforward. Building a system that can reliably execute that signal is a different engineering problem.

  • A trading signal and trade are distinct concepts in the NERV Trade engine.
  • Market analysis and broker execution are separated into distinct responsibilities.
  • Position and trade are separate entities, with trade owning its exposure.

How I built a live halftone portrait in React with just Canvas 2D

My portfolio is set like a newspaper, so my photo couldn't just be a photo. I wanted it to look like a printed halftone: a grid of dots, bigger where the picture is dark and smaller where it's light.

  • Image transformed into low-resolution grid of dots using Canvas 2D API
  • Dot radius determined by sample darkness with applied tone curve
  • Cursor interaction causes dots to swell and recede in a breathing effect

My users table reads one pagination contract: paginate(15), withQueryString, and a React pager that trusts meta

The first admin panel I built fetched all users, dumped them into state, and sliced pages client-side. It worked until a client hit 2,000 users and the list page took eleven seconds to load.

  • Implemented server-side pagination with Laravel's paginate(15) for 2,000+ users
  • React pager relied on backend meta data, fetching users based on page and meta
  • Consistent pagination contract extended to all admin panels in Laravel + React SaaS Starter Kit

More from Saturday 17 October →