Skip to content
Theory · Top-K and counters · lesson 7 of 11

Time windows

The list for the last minute must forget views older than a minute, and the day list views older than a day. Storing every view separately with its time is out: a day has 50 billion of them. This lesson is about keeping the minute, hour and day windows on a small state. It also covers what to do with events that arrive late or twice.

In this lesson

  • Buckets
  • Worked by hand
  • What a bucket size costs
  • Late and repeated events
  • Where the buckets live
  • Common mistake
  • Key points