Reference
Data Model
Tables, indexes, and deduplication rules used by the component.
Core tables
| Table | Description | Key indexes |
|---|---|---|
connections | OAuth tokens and provider links per user | by_user, by_user_provider, by_status |
dataSources | User + provider + device/source combinations | by_user_provider, by_user_provider_device, by_connection |
events | Workouts and sleep sessions | by_user_category_time, by_external_id, by_source_start_end |
dataPoints | Raw time-series samples | by_source_type_time, by_type_time |
timeSeriesRollups | Bucketed historical time-series aggregates | by_source_type_bucket, by_source_type_bucket_size, by_source_bucket, by_type_bucket |
dailySummaries | Precomputed daily aggregates | by_user_category_date, by_user_date |
syncJobs | Sync workflow records | by_user, by_user_provider, by_user_status, by_status |
oauthStates | Temporary OAuth PKCE state | by_state |
backfillJobs | Long-running historical data import tracking | by_connection, by_status |
Policy-related tables
| Table | Description | Key indexes |
|---|---|---|
timeSeriesPolicyRules | Default rules and preset rules | by_set, by_set_scope |
timeSeriesPolicyAssignments | Per-user preset assignment | by_user, by_preset |
timeSeriesPolicySettings | Global maintenance settings | by_key |
timeSeriesSeriesState | Per-source series maintenance cursor | by_source_series, by_next_maintenance, by_user |
Deduplication rules
Events
Events are deduplicated at two levels:
externalIdwhen the provider gives a stable identifierdataSourceId + startDatetime + endDatetimeas a second guardrail
Data points
Raw data points are deduplicated by:
dataSourceIdseriesTyperecordedAt
Rollups
Rollups are upserted by:
dataSourceIdseriesTypebucketMsbucketStart
Query strategy
The component separates raw rows and rollups so that:
- recent high-fidelity data can stay raw
- older dense history can become cheaper rollup buckets
- reads can choose the best available representation for the requested time range
For details on how tiers are resolved, see Storage Policies.