Part 1 of 8 · 1 min read
Why this page comes fifth in Level 12
In this module you will
- Scope a click aggregation system and size its event rate and storage.
- Design the two query APIs and the raw and aggregated data models.
- Use two queues and a map, aggregate and reduce pipeline to count clicks by minute.
- Handle late events with event time and a watermark, and choose between window types.
- Explain exactly-once results, hot ads, recalculation and the batch versus stream choice.
Counting clicks sounds easy: add one to a counter. At large scale it needs a stream pipeline, and because the counts decide how much advertisers pay, they must be right. This page puts the queue (page 1 of this level), idempotency (page 4) and stream processing (Level 6) to work together. The book used is "System Design Interview, Volume 2" by Alex Xu, the ad click event aggregation chapter. Numbers marked "made up" only show the idea.