Real-Time Analytics Platform  ·  View 09 of 21  ·  Data

Analytics Data Model

The tables the hot store actually holds, their keys and cardinality — including the dead-letter and schema-contract tables that most models omit.

Editable source SVG draw.io All views
schema_contract
schema_id PK
event_type
version
compat_mode
registered_at
deprecated_at
schema_contract...
events_raw
event_id PK
tenant_id
event_type
schema_id FK
event_time
ingest_time
payload dynamic
events_raw...
dlq_event
dlq_id PK
event_id FK
tenant_id
failure_reason
raw_payload
failed_at
retry_count
dlq_event...
dim_user
user_key PK
tenant_id
user_id_hash
segment
first_seen_at
valid_from
dim_user...
events_enriched
event_id PK/FK
tenant_id
user_key FK
session_id FK
product_key FK
geo
device
event_time
events_enriched...
session
session_id PK
tenant_id
user_key FK
started_at
ended_at
event_count
is_open
session...
dim_product
product_key PK
sku
category
price_band
valid_from
dim_product...
mv_metric_1m
bucket_start PK
tenant_id PK
metric_name PK
dimensions
value
event_count
mv_metric_1m...
mv_topn_5m
bucket_start PK
tenant_id PK
dimension
member
rank
value
mv_topn_5m...
1 : N
1 : N
0 : N
0 : N
1 : 1
1 : 1
1 : N
1 : N
N : 1
N : 1
N : 1
N : 1
1 : N
1 : N
1 : N
1 : N
Analytics Data Model — Hot Store
Analytics Data Model — Hot Store
Dimensions are slowly changing type 2; joins are on the surrogate key valid at event_time.
Dimensions are slowly changing type 2; joins are on the surrogate key valid at event_time.
v 1.0 · owner Data Architecture · date 2026-08
v 1.0 · owner Data Architecture · date 2026-08
Text is not SVG - cannot display

Modelling decisions

  • Raw payload kept as a dynamic column so a schema change never blocks ingestion
  • Both event_time and ingest_time are stored; every window is computed on event_time
  • Dimensions are slowly changing type 2, joined on the surrogate key valid at event_time

Pre-aggregation

  • mv_metric_1m is the query target for standard dashboards; raw scans are the exception
  • Top-N views are derived from the 1-minute view rather than recomputed from raw
  • A dashboard query that misses every view is a design signal, and is alerted on

Assumptions

  • Cardinality of tenant × metric × dimension stays below roughly 2 million active series
  • User identifiers arrive already hashed; the platform stores no clear personal identifier
  • Ad-hoc dimensions are attributes of the enriched table, not new materialized views