Part VI — The Blueprint · Lesson 11.10
HLD – Analytics Dashboard (Google Analytics)
In one lineAggregate on the server, render only what fits on screen, and never ship a million rows to a browser.
Where you've seen itChanging the date range on a dashboard and watching each card refresh on its own instead of the page going blank.
Diagram
| Step 1–2 | Scope and scale |
|---|---|
| In scope | widget grid · filters · date range · drill-down · export |
| Out of scope | data ingestion · ML insights · alerting config |
| Scale | billions of raw events · 10–20 widgets per dashboard · queries take 200ms–10s depending on range |
Lessons in this diagram10.15 Autocomplete & Search Bar5.1 Performance Overview6.9 API Caching
Lessons in this diagram6.10 State Management
How it works
- Server aggregates; the client receives chart-ready series, never raw events.
- Each widget is independent — own query, own cache key, own loading and error state.
- Downsample before plotting; beyond a couple of thousand points, more data adds no visible information.
- Filters live in the URL, making every dashboard state shareable and back-button friendly.
- Virtualize tables and move any heavy computation into a Web Worker.
Trade-offs
| Choice | Cost |
|---|---|
| Server aggregation | Less client flexibility; far less data transferred |
| Client aggregation | Interactive slicing; only viable for small sets |
| Per-widget loading | More requests; no blank-page stalls |
| Long cache TTL | Instant re-renders; risk of stale numbers |
Interview angle
"A widget needs to chart 40 million rows. How?"
- It doesn't — the server aggregates to the granularity the chart can actually show, typically a few hundred points.
- Downsample with an algorithm that preserves visual shape (LTTB) rather than naive sampling, which hides spikes.
- Keep the widget independently loaded and cached by its query key so other cards render while it works.
Recap
- Aggregate server-side; the browser gets chart-ready series.
- Independent widgets: one slow query must not blank the dashboard.
- Filters in the URL, cached by key — shareable and instant on return.