Design page-view and event analytics: ingest high-volume events with timestamps, session ids, and properties. Support real-time counters for dashboards and daily rollups for reports. Privacy-aware with sampling and PII minimization.
Functional requirements
- Ingest events via HTTP or batch API with schema validation
- Query aggregates by day, page, and campaign
- Optional sessionization by anonymous id cookie
- Export raw or aggregated data to warehouse (optional)
Non-functional requirements
- High write throughput with buffering and batch inserts
- Configurable retention and downsampling
- GDPR-friendly deletion of user-associated events