Appearance
user_activity_snapshots
DAU / WAU / MAU. Number of unique active learners across rolling windows of 1 / 7 / 14 / 30 days, counted from each
date.
- Grain:
(id_tenant, date) - ETL strategy:
merge - PK:
(id_tenant, date)
When to use it
- Engagement KPI (don't confuse with registrations).
- Platform health — is the active base growing along with the total base?
- Churn detection (DAU dropping while base is steady).
Columns
| Column | Type | Description |
|---|---|---|
id_tenant | BIGINT | FK → tenants.id. Part of PK. |
date | DATE | Reference day for the rolling-window counts. Part of PK. |
active_yesterday | INTEGER | DAU — unique learners active the day before date. |
active_7d | INTEGER | WAU — unique learners active in the last 7 days. |
active_14d | INTEGER | Unique learners active in the last 14 days. |
active_30d | INTEGER | MAU — unique learners active in the last 30 days. |
Usage pattern
sql
-- Stickiness: DAU/MAU over the last 30 days
SELECT date,
sum(active_yesterday) AS dau,
sum(active_30d) AS mau,
round(100.0 * sum(active_yesterday)::numeric / NULLIF(sum(active_30d), 0), 2) AS stickiness_pct
FROM metrics.user_activity_snapshots
WHERE date >= current_date - interval '30 days'
GROUP BY date
ORDER BY date;Stickiness > 20% usually indicates a healthy engagement.