# Low Level Design: Dashboard Service

Source: https://www.techinterview.org/post/3233471002/lld-dashboard-service/
Updated: 2026-07-26 · techinterview.org

## Data Model

### Dashboard Table


```
Dashboard (
  id,
  name,
  owner_id,
  layout JSONB,  -- grid positions
  created_at
)
```


### Widget Table


```
Widget (
  id,
  dashboard_id,
  type: line_chart | bar_chart | number | table | heatmap,
  query_id,
  title,
  position JSONB,
  refresh_interval_seconds
)
```


### Query Table


```
Query (
  id,
  metric,
  dimensions,
  filters,
  aggregation,
  time_granularity
)
```


## Dashboard Render

  - Load dashboard config (widgets, layout). This is one read that joins the Dashboard and Widget rows, returning the grid positions and each widget's query reference — but no metric data yet. Keep config separate from data so the frontend can paint the empty grid immediately, and run the permission check here before any query executes.

  - Parallel fetch all widget data. Fan out one concurrent request per widget instead of fetching serially, so a dashboard with twenty widgets renders in the time of its slowest query rather than the sum of all of them. Give each fetch its own timeout and return partial results — one slow or failing widget should never block the rest of the board.

  - Return combined response to client. Shape the payload as a map of `widget_id -> result` so the frontend can drop each result into its grid slot without reordering. Include a per-widget status field so a widget that timed out or errored renders an error state while its neighbors render normally.

## Data Fetch & Caching

Each widget query hits Redis cache first. On miss, executes against metrics store (TimescaleDB or [ClickHouse](https://www.techinterview.org/companies/clickhouse-interview-guide/)). Result cached with TTL equal to `refresh_interval_seconds`.

## Real-Time Refresh

Client polls `/dashboards/:id/data` every N seconds, or [WebSocket](https://www.techinterview.org/post/3233474372/system-design-design-discord-voice-text-channels-server-architecture-webrtc-permissions-bots-real-time-presence/) push is used on metric update for lower latency.

## Time Range Selector

Global time range selector applies to all widgets on the dashboard simultaneously.

## Drill-Down

Clicking a chart segment applies a filter and reloads only the affected widgets.

## Sharing

### DashboardShare Table


```
DashboardShare (
  dashboard_id,
  user_id or team_id,
  permission: view | edit
)
```


## Snapshot Export

Dashboard can be exported as PNG via headless Chrome screenshot.

## Template Library

Pre-built dashboard templates per use-case (e.g., SaaS metrics, infrastructure monitoring, sales pipeline).

See also: [Databricks Interview Guide 2026: Spark Internals, Delta Lake, and Lakehouse Architecture](https://www.techinterview.org/post/3233460280/databricks-interview-guide-2026-spark-internals-delta-lake-and-lakehouse-architecture/)

See also: [Netflix Interview Guide 2026: Streaming Architecture, Recommendation Systems, and Engineering Excellence](https://www.techinterview.org/post/3233460274/netflix-interview-guide-2026-streaming-architecture-recommendation-systems-and-engineering-excellence/)

See also: [Atlassian Interview Guide](https://www.techinterview.org/post/3233459919/atlassian-interview/)
