FSD Frontend System Design

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.

  • Time19 min
  • DiagramQuery pipeline + widget grid with independent loading
  • Chapter11 · High Level Design

Diagram

Step 1⁠–⁠2Scope and scale
In scopewidget grid · filters · date range · drill-down · export
Out of scopedata ingestion · ML insights · alerting config
Scalebillions of raw events · 10–20 widgets per dashboard · queries take 200ms–10s depending on range
diagram
diagram

Lessons in this diagram10.15 Autocomplete & Search Bar5.1 Performance Overview6.9 API Caching

diagram

Lessons in this diagram6.10 State Management

How it works

  1. Server aggregates; the client receives chart-ready series, never raw events.
  2. Each widget is independent — own query, own cache key, own loading and error state.
  3. Downsample before plotting; beyond a couple of thousand points, more data adds no visible information.
  4. Filters live in the URL, making every dashboard state shareable and back-button friendly.
  5. Virtualize tables and move any heavy computation into a Web Worker.

Trade-offs

ChoiceCost
Server aggregationLess client flexibility; far less data transferred
Client aggregationInteractive slicing; only viable for small sets
Per-widget loadingMore requests; no blank-page stalls
Long cache TTLInstant 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.