KatInterview

Real-Time Metrics Dashboard Architecture

System DesignModel answer
MediumModel answerSystem Designmonitoringtime-seriesdata-ingestion

Last updated

Build a dashboard that shows time-series metrics with clear separation between data ingestion delay and query response time.

You need to architect a dashboard that visualizes time-series metrics in real time. The system must handle two distinct latency concerns: how fast newly arrived data points appear on screen, and how quickly users can render or modify their visualizations.

Scope

Your system receives numbered data points, each tagged with a timestamp, metric identifier, and key-value labels (e.g., cpu_usage{host="web-1", region="us-east"}). Dashboard users select a metric, apply label filters, and choose a time window to generate a chart.

Design the complete flow: how data enters the system, where and how it's stored, what transformations occur, how queries execute, and how browsers stay current. You do not need to specify exact throughput numbers or retention policies, but your design should accommodate realistic scale.

Key Challenges

  • Latency semantics: Define what "low latency" means for both data freshness and interactive performance, and explain how you'd measure each.
  • Out-of-order arrival: Data points may arrive late or out of sequence.
  • Query efficiency: A chart spanning hours or days shouldn't scan millions of individual measurements.
  • Staleness detection: Browsers must recognize when displayed data is outdated.
  • Overload scenarios: Handle ingestion spikes, slow queries, and high-cardinality label explosions.

Describe your architecture with enough detail to reason about where delays occur and how you'd verify latency targets are met.

Hints

Hint 1

Think about pre-aggregation: raw points work for short windows, but wider time ranges need summary buckets.

Hint 2

Freshness and query speed are independent—optimize them separately with different techniques.

Hint 3

Consider how a browser knows its chart is stale vs. current, especially after network interruptions.