Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

Launch price

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansStart free instead

Module 11 · System Design · Five more whole designs

Counting clicks in real time (ad click aggregation and top-k)

Before you start. You need three things. A queue is a line that one part of a system writes to and another reads from at its own speed, and a partition is one lane of it (The order slip rail (queues & the utilization cliff) gave you the queue and what happens when it fills). A count-min sketch is a small grid of counters that guesses how often each thing appeared, never too low and sometimes too high (Counting the crowd without a register (HyperLogLog, count-min, top-k) built one). And the six steps of a design round from Design the Whole Thing (the interview, assembled): clarify, estimate, API, data, design, scale.

Lesson 52 of 73 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 20 February 2002: a click becomes money
  • The click log: the receipt roll that nothing else may contradict
  • Stream processing: a tally that does not wait for closing time
  • Late events and the watermark: when is a minute really over?
  • Hot ad partition: one lane gets the whole stampede
  • The same click twice, and the id that makes it harmless
  • The count-min sketch: a fast answer at a fixed size
  • Reconciliation: the end-of-day count of the roll against the board
  • 1. Clarify
  • 2. Estimate
  • 3. API
  • 4. Data
  • 5. Design
  • 6. Scale
  • The follow-up: top 100 ads in the last minute
  • What to say about scale

Terms it explains: click log, Stream processing, tumbling window, late event, watermark, skew, hot partition, click id, count-min sketch, reconciliation.

Review System Design