Design a Loyalty-Data Insight Platform
Design a data platform that ingests billions of loyalty events and serves fresh operational insights plus exactly reconciled daily reports.
Problem statement
Design a system that processes billions of loyalty-data records and generates meaningful insights.
For this exercise, assume merchants send earn, redeem, and adjustment events. Analysts query member, campaign, and merchant aggregates through dashboards and exports. Every event has a merchant-scoped idempotency key, accepted events are immutable, and corrections arrive as compensating events.
Operational aggregates should appear within five minutes, while daily reports must reconcile exactly to accepted source events. Retain events for seven years. Machine-learning recommendations and customer-facing redemption flows are outside scope.
What to build
- Accept merchant earn, redeem, and adjustment events idempotently.
- Serve member, campaign, and merchant aggregates to dashboards within five minutes.
- Generate bounded analytical exports for authorized merchant users.
- Produce daily reports that reconcile exactly to accepted immutable events and compensating corrections.
At scale
- For this exercise, assume 10 billion retained events and seven years of retention.
- For this exercise, assume 100,000 incoming events per second at peak.
- For this exercise, assume 2,000 concurrent analytical queries.
- For this exercise, assume operational aggregates have a five-minute freshness target and daily reports require exact reconciliation.