Building Real-Time Dashboards with Live Data Feeds
Static reports are dead by the time you read them. A weekly sales report tells you what happened last week, not what’s happening right now. A monthly inventory summary shows you last month’s numbers, but the stock levels have changed since breakfast. For businesses where timing matters, where decisions need to be made based on current conditions rather than historical snapshots, real-time dashboards change how you operate.
A real-time dashboard shows live data as it changes. Sales numbers update as transactions process. Inventory counts adjust as items are sold or received. Customer support queues reflect what’s happening this moment, not what the last report captured. The difference between stale data and live data is the difference between reacting to problems and preventing them. If you would rather see how it all fits together, we wrote everything we have learned building custom web applications.
We build custom real-time dashboards for small businesses that need to see what’s happening now, not what happened yesterday. Here’s what goes into building a dashboard that delivers live data reliably and presents it in a way that drives decisions.
When You Need Real-Time Data
Not every dashboard needs to be real-time. A monthly revenue trend chart updated daily is perfectly adequate. Real-time capability adds complexity and cost, so it should be reserved for data where timeliness directly affects decisions.
Real-time dashboards make sense when:
- Operational decisions depend on current state. A warehouse manager needs current stock levels, not yesterday’s count, to decide whether to accept a large order.
- Response time matters. A support dashboard showing current queue depth and wait times lets managers reassign staff before customers get frustrated.
- Activity monitoring. Website traffic during a marketing campaign, transaction volume during a sale event, or system health metrics all benefit from real-time visibility.
- Multi-location coordination. When multiple locations or teams need to see the same current data to coordinate, real-time sync prevents conflicts and miscommunication.
- Threshold-based actions. If a metric crossing a threshold triggers a business action (reorder when stock drops below 50, escalate when wait times exceed 10 minutes), real-time data ensures the action happens immediately, not hours later.
Real-Time Data Transport: Three Approaches
Getting live data from your server to the browser requires a persistent or semi-persistent connection. Three technologies handle this differently, and each has tradeoffs that affect which is right for your dashboard.
WebSockets
WebSockets create a persistent, bidirectional connection between the browser and server. Once established, either side can send messages at any time without the overhead of new HTTP requests.
How it works:
- The browser initiates a WebSocket connection via an HTTP upgrade request
- The server accepts, and the connection stays open
- The server pushes data to the browser whenever something changes
- The browser can also send messages back to the server
- The connection stays open until explicitly closed
Best for:
- Dashboards that need the fastest possible updates (sub-second latency)
- Applications where the browser also sends data (chat, collaborative editing)
- High-frequency data updates (multiple updates per second)
Considerations:
- Requires WebSocket support on your server and infrastructure (load balancers, proxies)
- Connection management is more complex (handling disconnects, reconnections)
- Each connected client holds an open connection, which consumes server resources
- Some corporate firewalls and proxies can interfere with WebSocket connections
Libraries and tools:
- Socket.IO provides WebSocket connections with automatic fallbacks, reconnection, and room-based broadcasting
- ws is a lightweight WebSocket library for Node.js
- Pusher and Ably are managed WebSocket services that handle the infrastructure
Server-Sent Events (SSE)
SSE is a simpler, one-directional alternative to WebSockets. The server pushes updates to the browser over a standard HTTP connection. The browser can’t send messages back through the same connection (it uses regular HTTP requests for that).
How it works:
- The browser creates an EventSource connection to a server endpoint
- The server holds the connection open and sends events as text streams
- The browser receives events and triggers JavaScript handlers
- If the connection drops, the browser automatically reconnects
Best for:
- Dashboards that only receive updates (most dashboards)
- Simpler infrastructure requirements (works through standard HTTP proxies)
- Moderate update frequencies (every few seconds to every few minutes)
Considerations:
- One-directional only (server to browser)
- Limited to text data (no binary)
- Maximum of 6 concurrent connections per domain in some browsers (HTTP/1.1 limitation, resolved with HTTP/2)
- Simpler server implementation than WebSockets
Why SSE is often the right choice for dashboards: Most dashboards only need the server to push data to the browser. The browser doesn’t need to send real-time data back. SSE provides exactly this with less complexity, better automatic reconnection, and broader infrastructure compatibility than WebSockets. For the majority of business dashboards, SSE is the better choice.
Polling
Polling is the simplest approach. The browser makes regular HTTP requests to the server at a set interval, asking for the latest data each time.
How it works:
- The browser sends an HTTP request to an API endpoint
- The server responds with the current data
- The browser waits for a set interval (e.g., 10 seconds)
- Repeat
Best for:
- Data that changes infrequently (every few minutes or less)
- Situations where infrastructure constraints prevent WebSockets or SSE
- Simple implementations where the overhead is acceptable
- Data that doesn’t need to be truly real-time (near-real-time is fine)
Considerations:
- Not truly real-time. Updates are delayed by the polling interval.
- Inefficient when data changes rarely. Most requests return the same data.
- Higher server load for frequent polling intervals.
- Simple to implement and debug.
Long polling is a variant where the server holds the request open until new data is available, then responds. This reduces the number of empty responses but adds connection management complexity.
Choosing the Right Approach
For most small business dashboards, here’s the decision framework:
- Updates needed multiple times per second? Use WebSockets.
- Updates needed every few seconds, server-to-client only? Use SSE.
- Updates needed every minute or less frequently? Polling is fine.
- Infrastructure constraints (restrictive firewalls, shared hosting)? Start with polling, upgrade to SSE if possible.

Real-Time Data Architecture
The data transport is only half the story. On the server side, you need architecture that detects changes and pushes them efficiently.
Event-Driven Architecture
The best approach for real-time dashboards is event-driven. Instead of querying the database on a timer, your system emits events when data changes, and those events trigger dashboard updates.
The flow:
- A business event occurs (sale, inventory change, support ticket created)
- The event is published to a message broker or event bus
- The dashboard server subscribes to relevant events
- When an event arrives, the server processes it and pushes updated data to connected browsers
This approach is efficient because updates only happen when data actually changes. If no sales occur for 5 minutes, no updates are sent. When a burst of sales happens, updates flow immediately.
Message Brokers
For applications with multiple data sources or high event volume, a message broker coordinates events:
- Redis Pub/Sub is lightweight and fast, ideal for single-server deployments or moderate scale
- RabbitMQ provides durable message queuing with routing and retry capabilities
- Apache Kafka handles high-volume event streams with persistence and replay capability
For most small business dashboards, Redis Pub/Sub provides more than enough capability. The events are typically low-volume (dozens per minute, not thousands per second), and the simplicity of Redis keeps the architecture manageable.
Aggregation Layer
Raw events aren’t always what you want on the dashboard. A sale event contains one transaction, but the dashboard might show total revenue for the day, average order value, or sales by category. An aggregation layer sits between the raw events and the dashboard, maintaining running calculations that update with each new event.
This aggregation can happen:
- In memory on the server. Fast and simple for single-server deployments.
- In a cache like Redis. Shared across multiple server instances.
- In a database with materialized views. For complex aggregations that need persistence.
Charting and Visualization

Data on a dashboard needs to be immediately understandable. Numbers matter, but charts and visualizations communicate trends and patterns at a glance.
JavaScript Charting Libraries
For custom dashboards, JavaScript charting libraries render interactive charts in the browser:
- Chart.js is lightweight, easy to use, and handles the most common chart types (line, bar, pie, doughnut) well. Ideal for dashboards that need standard charts without heavy customization.
- D3.js is the most powerful and flexible visualization library. It can create virtually any visualization but has a steep learning curve. Best for highly custom or complex visualizations.
- Apache ECharts offers a wide range of chart types with good performance for large datasets. Strong support for real-time chart updates.
- Recharts is built on D3 for React applications. Good for React-based dashboards.
- Lightweight alternatives like uPlot or Frappe Charts are small, fast, and suitable for dashboards that prioritize performance.
Chart Types for Business Dashboards
Different data calls for different visualizations:
Updating Charts in Real-Time
When new data arrives, charts need to update smoothly without jarring redraws:
- Append new data points to time-series charts and shift the window forward
- Animate transitions when values change so the user can follow what moved
- Avoid full redraws when possible. Most charting libraries support incremental updates.
- Batch rapid updates. If events arrive faster than the user can perceive (more than a few per second), batch them and update the chart at a fixed interval (e.g., once per second).
Dashboard Design Principles
A real-time dashboard that shows everything is a dashboard that shows nothing. Design decisions about what to display, how to organize it, and how to handle information hierarchy determine whether the dashboard actually gets used.
Hierarchy of Information
- Top-level KPIs. The 3-5 most important numbers belong at the top of the dashboard in large, easily scannable format. Revenue today, open tickets, active users, whatever the key metrics are.
- Trend charts. Below the KPIs, show how those numbers are trending. Is revenue up or down compared to yesterday? Is the support queue growing or shrinking?
- Detail sections. Further down, provide drill-down data for users who want to investigate. Recent transactions, top products, individual team member metrics.
- Alerts and exceptions. Highlight anomalies and threshold breaches prominently. If something requires action, it should be immediately visible.
Designing for Glanceable Understanding
Many dashboards are displayed on wall-mounted monitors where people glance at them throughout the day:
- Use large fonts for key numbers. They should be readable from across the room.
- Use color intentionally. Green for on-track, yellow for warning, red for critical. Don’t use color decoratively.
- Minimize text. Labels should be short. If a metric needs a paragraph of explanation, it doesn’t belong on the dashboard.
- Show change direction. Up arrows, down arrows, and percentage changes tell the story faster than raw numbers alone.
Handling Connection Issues
Real-time dashboards must handle network interruptions gracefully:
- Show connection status. A small indicator showing whether the live connection is active.
- Display data age. Show when the data was last updated. “Updated 2 seconds ago” reassures users that data is current. “Updated 5 minutes ago” warns them that something may be disconnected.
- Reconnect automatically. When the connection drops, the dashboard should attempt to reconnect and refresh data without requiring a manual page reload.
- Cache the last known state. If the connection drops, keep showing the last received data rather than going blank.
Security Considerations
Real-time dashboards often display sensitive business data. Security needs attention at every layer.
- Authentication. Require login to access the dashboard. Don’t rely on obscure URLs as security.
- Authorization. Different users may need access to different data. A sales manager might see revenue; a warehouse worker sees inventory but not financial data.
- Encrypted connections. All data transport (WebSockets, SSE, polling) should use TLS encryption.
- Input validation. If the dashboard accepts any user input (date filters, search queries), validate and sanitize it server-side.
- Rate limiting. Protect your real-time endpoints from abuse.
Performance at Scale
As more users connect to a real-time dashboard and data volume grows, performance becomes a concern.
- Connection pooling. Manage WebSocket or SSE connections efficiently. Each connection consumes memory and file descriptors on the server.
- Data filtering. Send each client only the data they need. A dashboard showing one location’s data shouldn’t receive events from all locations.
- Throttling updates. If data changes faster than the display needs to update, throttle updates to a reasonable interval. Humans can’t perceive changes faster than about 10 times per second.
- Horizontal scaling. For dashboards with many concurrent users, use a message broker (Redis Pub/Sub) to coordinate between multiple server instances, each handling a portion of the connections.