Real-time vs batched dashboards: when each one is the right call
Most "real-time" dashboards don't need to be. The question to ask before architecting: how stale can the data be before a decision-maker notices? If the answer is "minutes," batch it. If the answer is "seconds," go real-time.
Batched (5-minute or hourly refresh). Right for SaaS revenue dashboards, marketing funnel reports, weekly business reviews. Implementation: a server-side route runs the aggregation queries, caches the result, the page refreshes on a timer. Simple to build, cheap to run, scales to thousands of users.
Real-time (sub-second). Right for ops dashboards watching production traffic, on-call alert views, live event monitoring. Implementation: Supabase Realtime channels push row changes to subscribed clients, or you poll a status endpoint every second. More expensive on Postgres connections; you'll want a connection pool. Webtwizz can scaffold either pattern; tell it which.
Hybrid. Most production dashboards. Top-line KPIs batch every 5 minutes. A single "live now" widget streams. Cheap on the database, snappy on the metric that matters.
The trap: defaulting to real-time everywhere. It's expensive and most users won't notice.
