Blog

Real-Time Analytics Architecture for User-Facing Dashboards

A user-facing real-time analytics dashboard succeeds through a sequence of architecture decisions. Fresh data’s availability under production load depends on metric latency tiers, ingestion-time aggregation, and concurrency controls. The central design task is to make those decisions work together, rather than optimize query speed while leaving the rest of the system exposed.

What "real-time" actually requires from a dashboard architecture

Over-engineering is as common a failure as under-building. Most user-facing dashboards need near-real-time data, so a sub-second requirement needs justification. The appropriate target depends on the decision a metric supports. Requests-per-second and daily-active-users do not demand the same clock speed, even when they appear on the same screen.

Ingestion latency describes how quickly data becomes queryable, while query latency describes how quickly the database returns an answer. Freshness concerns whether that answer reflects the latest events, and concurrency concerns whether the system holds up when users arrive together. A fast response alone proves very little. It may come from a stale cache, while fast ingestion may still feed a serving layer that struggles when requests arrive at the same time.

Tiering metrics by latency before writing any code

The first concrete design decision is therefore to assign each metric a latency SLA and a delivery mechanism before choosing tools. Tier 1 has operational signals such as requests-per-second, which need sub-second delivery through WebSocket push. Tier 2 has error rates and revenue-today, which use near-real-time delivery through SSE with periodic refresh. Tier 3 has aggregates such as daily-active-users, which use periodic polling and a 5-minute cache. These tiers separate workloads that happen to share an interface.

The classification also needs an operational test. A metric belongs in the live layer only when someone owns it, a threshold is defined, and a response path is ready. Otherwise, it belongs in a periodic report. This prevents the fastest delivery path from becoming the default for every available measure. It also establishes which results can tolerate caching before the team designs the data model and serving path.

Why querying raw event tables directly at dashboard load time breaks at scale

Without pre-aggregation, each dashboard refresh asks the database to reconstruct answers from raw events. Every panel can issue an independent query, and every concurrent user multiplies that work. With this query amplification, each refresh cycle sends a burst of work to the database all at once. More panels mean more repeated aggregation, even when the underlying questions have not changed. The dashboard is slow by design.

Raw-row recomputation increases both query latency and I/O cost as the event history grows. The system repeatedly calculates results that could have been prepared when the data arrived. A poorly aligned ORDER BY makes this worse by preventing common filters from skipping enough of the table. Even with a well-chosen sort key, the system still has to repeat the aggregation.

That query load also competes with ingestion for I/O. Heavy reads can slow the arrival of new data, making the dashboard less fresh precisely when more people are using it. This creates a conflict between responsiveness and freshness. Optimizing the visible query alone leaves that conflict unresolved because the read path still consumes resources needed by the write path. The architecture needs to change when aggregation happens.

Pre-aggregating at ingestion time with materialized views

Insert-time materialized views move aggregation to the point where events enter the analytical store. As rows arrive, the views update incrementally and maintain the rollups that dashboard queries need. The serving query then reads a small pre-computed result, avoiding a scan of millions of raw rows. This is the highest-leverage change in the pipeline.

The same decision can simplify the surrounding infrastructure. When the OLAP store can perform the required transformations and aggregation at insert time, a separate stream processor and staging layer are not automatically necessary. Flink or Spark Streaming become optional for most dashboard workloads. The condition is important. The store must be able to handle that transformation workload, so pre-aggregation does not by itself settle the ingestion architecture.

Approximate functions such as uniq() allow a small, bounded error margin so they can calculate cardinality faster on large datasets. That tradeoff is acceptable for most dashboard measures such as active users and unique visitors. It should be deliberate. Defining the acceptable error in the data model replaces default exactness with an accuracy requirement that reflects the metric’s actual use.

Choosing an ingestion architecture that keeps data fresh without overwhelming the serving layer

Pre-computed results are only as current as the pipeline feeding them. The appropriate ingestion pattern therefore depends on event volume, transformation needs, and tolerable freshness lag. In a streaming pipeline, events pass through Kafka and a stream processor before they reach the OLAP store. It works well for millions of events per hour when they need complex multi-consumer fan-out. That complexity justifies an intermediate processing layer when several consumers need the stream.

Direct ingest removes those intermediate stages when the OLAP engine can handle the transformations itself. Events enter the store, and insert-time materialized views perform the required work. Micro-batch or polling offers another fit. When near-real-time refresh is enough and keeping the system simple to run matters most, continuous streaming may add infrastructure while leaving the decision the dashboard supports no better. The latency tiers provide the basis for choosing among these patterns.

In a hybrid OLAP and lakehouse design, raw events enter a bronze layer for reprocessing, governance, and ML, while curated aggregates enter the dashboard serving layer. Historical processing can then evolve without touching the serving layer. Replay design still needs care. Kappa uses a stream-only path with replay from a durable log, but requires robust schema evolution and idempotent processing. Lambda keeps results correct through separate batch and speed layers, but doubles the code paths and adds to the work of running the system. Most production dashboard teams use a hybrid, combining Kappa-style real-time processing with periodic batch correction jobs for historical accuracy.

Managing concurrency so live dashboards do not become a denial-of-service attack on the database

Pre-aggregation reduces the cost of a query, but it does not control how many queries arrive together. A dashboard with many panels can still generate many independent requests on every refresh. Under concurrent use, even inexpensive queries accumulate into a surge. An API and caching tier provides the place to manage that demand before it reaches the serving engine.

Caching absorbs repeated identical queries within the same window. Redis is a common choice for this layer, allowing users loading the same dashboard to share cached results and avoid repeated database queries. The cache window must fit the latency tier of the metric. Otherwise, a system can seem fast while returning data that is older than its freshness target allows. Caching solves repeated demand only when its freshness tradeoff is explicit.

Time-range query deduplication addresses the complementary problem of panel-by-panel fetching. Batch-fetching the data for the panels through a single API call keeps each panel from sending its own requests to the database. The API also constrains which requests can reach production serving. Time-range limits, dimension cardinality caps, and result-size limits keep ad-hoc query shapes from entering the same path unchecked. These controls give the database a bounded workload rather than exposing it directly to every interaction in the interface.

Query-level optimizations that change what the database has to do at serving time

Once ingestion and concurrency are controlled, schema design determines how much data each permitted query must examine. The first sort-key columns should match the filters used most often in the dashboard. If users consistently filter by tenant_id and event_date, those columns belong at the front of ORDER BY. Dimensions that are never filtered can be omitted. This sort-key layout lets the engine skip irrelevant data before scanning.

Time-based partitioning applies the same principle to the table’s history. Partitions aligned with common dashboard time ranges limit recent-period queries to the relevant partitions within the full historical dataset. Filter pushdown complements that layout by restricting the data the query has to process. These are not merely finishing touches. They change the amount of work left at serving time after pre-aggregation has already removed raw-event recomputation.

Approximation also applies beyond unique counts to quantile and percentile metrics. Functions such as quantileTDigest() are appropriate where a small, bounded error is acceptable and lower latency is valuable. The relevant decision belongs in the metric definition. A serving query should not introduce an unexpected accuracy tradeoff simply because production traffic exposes a slow calculation. Choosing the function with the data model keeps the result’s meaning aligned with the performance target.

What production deployments reveal about where these decisions compound

Canva built a multi-agent customer support experience using Langfuse for observability, prompt management, and evaluation. Langfuse’s official Canva user story describes a multi-layered support system comprising Help Assistant and OmniAgent. The example broadens the workload beyond conventional product analytics. Agentic AI systems also produce event streams with high volume and high cardinality that need an analytical serving architecture. Their observability needs bring the same questions about fresh data and interactive access into another production setting.

The case illustrates workload relevance. Canva’s sort keys, materialized views, ingestion topology, and concurrency controls remain unspecified in the available account of its use of Langfuse. The architectural implication is narrower but useful. A dashboard serving agent observability cannot treat event volume and cardinality as separate from the cost of repeatedly answering user queries.

Ingestion design determines how current those results can be. This is why performance depends on the whole path from event arrival to dashboard delivery, rather than on an engine’s query speed considered alone.

Choosing a platform that natively supports all four dimensions rather than assembling them

A platform that handles ingestion, pre-aggregation, query serving, and concurrency within one engine reduces the number of components the team must coordinate. That has operational value beyond query performance. In an assembled stack, the team also operates the connections between the event pipeline, processing layer, analytical store, and serving path. Those connections can become the weakest link even when each component performs well on its own.

The platform therefore needs to be judged across ingestion latency, query latency, freshness, and concurrency together. Fast ingestion is insufficient if concurrent dashboard requests overwhelm serving, just as fast cached responses are insufficient when the cache violates the freshness requirement. Each dimension constrains the others. Native support can reduce the surrounding infrastructure needed to meet those constraints, but it does not make the constraints disappear.

No platform removes the need to design the workload. Sort keys, partition strategies, materialized view definitions, and API-layer concurrency management still require explicit choices. The metric tiers establish what those choices must achieve. The team must still assess how much infrastructure it will need to operate to deliver that behavior under production load.

All posts