PrepCity

Stream processing

Open the lab

By the last page, this is the design you will have built. Drag it, or Show all, to see every part.

Lesson · 5 pages · about 4 min

Stream processing

A stream processor keeps running totals and saves them in checkpoints. When it crashes it replays from the last one, and whether that counts sales twice depends on the table it writes to.

What it is
A program that runs all the time, reads each event as it arrives and keeps running totals in memory. Apache Flink is a popular one.
What it is for
It gives results minutes old instead of a day old. The catch: it can crash, and must restart without losing or double-counting anything.
Use it when
When results must be fresh within minutes: live sales, fraud checks, alerts.
Not when
When a daily report is enough. A nightly batch job is far cheaper and simpler to run.

Words you’ll learn

  • Stream processor
  • Event
  • Late event
  • Stream
  • Topic
  • Checkpoint
  • Row
  • Upsert
  • Idempotent
  • Commit

Page by page