Skip to content

Stream & Batch Processing

Some data arrives once and is complete, and some never stops arriving. A job over the first kind can read it all and end. A job over the second has to say what time means for an event, when a result is final, and what happens when a consumer dies halfway through. This module is about both shapes of job, and about the log that most streams are built on.

You will work with a live stream lab of partitions, consumer groups, offsets and replay, three sorting exercises, quizzes, and a worked example of windows and late events. Every lesson has a moment where the consumers fall behind, a crash repeats work, or an event arrives too late.

  1. Batch and stream: logs, partitions and consumer groups (18 min). What separates a batch from a stream, how a partitioned log shares work between consumers, and why a hot key stays in one partition.
  2. Event time, windows and late events (22 min). The two clocks of an event, three kinds of window, what a watermark promises, and what waiting for late events costs.
  3. Offsets, replay and what exactly-once really means (20 min). How a group resumes after a crash, why some messages are read again, and where the exactly-once boundary stops.
  4. Change data capture: turning a database into a stream (16 min). Dual writes, polling and reading the database’s log, and what each one loses.
  5. Lambda, kappa and reprocessing history (16 min). Two paths or one, how long a replay takes, and what retention limits.
  6. Recap and quiz (12 min). The module in one page, a design checklist, and a quiz.
  • Say when a batch is enough and when an answer needs a stream, and work out how long an event waits for a batch.
  • Size a consumer group against the partitions of a topic, read consumer lag, and recognise a hot partition.
  • Choose between event time and processing time for a count, and trace a late event through a window with and without allowed lateness.
  • Explain what exactly-once processing promises and where it stops, and make an effect happen once when messages repeat.
  • Compare dual writes, polling and log-based capture, and work out how long a replay of history takes.

All the numbers in the labs and examples are illustrative. They are for comparing choices, not for forecasting any real product.

Built by GhaziAlibi.

© ShardCraft. All rights reserved.