Requirements clarified: show step conversion rates for the onboarding funnel, daily/weekly trends, segmentation by source/country/device, <=15‑minute freshness, and interactive drill-downs.Key panels- Overview funnel: step-by-step conversion %, drop-off counts, absolute counts.- Trend panel: time-series of conversion rate and absolute users (daily/weekly toggle).- Segmentation panels: stacked bar or small-multiples by source / country / device with top N + “Other”.- Cohorts / Retention: cohort heatmap to see downstream activation.- Table + drill-down: top flows, user lists, and ability to click any cell to open detail by user cohort/time window.Data sources & pipeline- Event stream (client SDK -> Kafka) for raw events (user_id, event_name, timestamp, device, country, source).- OLAP warehouse (BigQuery / Snowflake / Redshift Spectrum) as canonical store.- Streaming micro-batch ETL (Airflow + dbt or Spark Streaming) to: 1) ingest events, 2) deduplicate, 3) populate raw_events (append) and 4) maintain materialized aggregate tables for recent windows (15m), daily rollups, weekly rollups.Aggregation strategy (to keep queries fast)- Materialize incremental aggregates: - real_time_15m_rollup: event counts by minute, step, source, country, device (partitioned by minute). - daily_rollup: date, step, source, country, device. - funnel_aggregates: precomputed conversions between steps per segment.- Use partitioning (time), clustering (user_id or country) and columnar storage.- Keep cardinality low by pre-bucketing high-cardinality fields (e.g., top 100 countries, map others to “Other”).Recommended SQL example for 15-min rollupsql
-- run every 5 minutes to update 15-min materialized table
INSERT INTO real_time_15m_rollup (minute, step, source, country, device, cnt)
SELECT
TIMESTAMP_TRUNC(event_ts, MINUTE) as minute,
event_name as step,
COALESCE(source,'unknown') as source,
COALESCE(country,'unknown') as country,
device_type as device,
COUNT(DISTINCT user_id) as cnt
FROM raw_events
WHERE event_ts >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR)
GROUP BY 1,2,3,4,5;
Visualizations & interactions- Funnel chart for conversion; show absolute and percent.- Line chart with dual axis (count and conversion rate) for trends.- Small multiples / treemap for device/source/country.- Heatmap for cohort retention.- Use dashboard actions (Tableau/Power BI bookmarks & filters) to drill from funnel to time-series to raw user table.- Expose date grain toggles and top-N filters to limit cardinality.Performance considerations- Serve dashboards from the pre-aggregates; avoid ad‑hoc scanning of raw_events.- Cache dashboard queries for common parameter sets; TTL ~1–5 min for near-real-time responsiveness.- Use query pushdown and limit joins; join only to small dimension tables.- For very high-cardinality segments do server-side top-N: compute top 50 in materialized aggregates and let UI request further detail on demand.- Monitor query patterns and add materialized views for expensive filters.- Use approximate distinct algorithms (HyperLogLog) for very large distinct counts when exactness is not required.Operational & governance- SLAs: 15-min freshness via 5-min micro-batches and monitoring (alert if lag >5m).- Data quality checks (schema, nulls, duplicate user_id) in ETL.- Access controls and anonymization for PII.Why this design- Pre-aggregation + columnar OLAP provides sub-second or low-second dashboard queries at 10M MAU scale.- Streaming ingestion + micro-batch ensures freshness target.- Materialized, segmented rollups enable fast drill-downs while keeping storage and compute efficient.