Event Streaming LabPython · Bytewax

Hands-on Python lessons

Event streaming
with Python.

Process events, group them into windows and handle late arrivals. Learn how state, replay and recovery affect a streaming application.

30 runnable lessons 16 design readings Basic Python

Course contents

Part 1

Events, logs and consumers

Follow events through transformations, logs and independent consumers.

  1. 01Follow an eventFrom a record to a useful stream.Lab
  2. 02Evolve an event schemaA record can parse and still mean the wrong thing.Lab
  3. 03Read a partitioned logOrdering has a scope.Lab
  4. 04Stream live through KafkaA producer, a socket, and an engine that keeps listening.Lab
  5. 05Retain or compact a logHistory and latest state answer different questions.Lab
  6. 06Give consumers their own positionReading does not erase the log.Lab
Part 2

Transformation and routing patterns

Validate events, route failures and expand records into multiple outputs.

  1. 07Choose a streaming architectureA work queue, a broadcast and a retained history solve different problems.Reading
  2. 08Route and quarantine eventsGive invalid records a visible destination.Lab
  3. 09Expand and re-key a streamOne cart becomes several independently identified lines.Lab
Part 3

Time, windows and late data

Use event-time windows and decide how to handle late arrivals.

  1. 10Choose the right clockThe same order can belong to two different windows.Lab
  2. 11Close a windowGive an endless calculation a boundary.Lab
  3. 12Merge a sessionA late event can connect two groups.Lab
  4. 13Wait for late eventsTrade a faster answer for a more complete one.Lab
  5. 14When can time move forward?Slow partitions, idle inputs and late returns.Reading
  6. 15Correct a late resultClosing a window and forgetting it are separate decisions.Lab
Part 4

Stateful patterns, joins and views

Keep state by key, join streams and maintain changing results.

  1. 16Keep state by keyTwo shops. Two running totals.Lab
  2. 17Where does a key live?Partitions, exchanges and parallel state.Reading
  3. 18Build a materialized viewUpdates replace facts; deletes must leave enough history.Lab
  4. 19From streams to tables and backAn append, an upsert and a retraction carry different meaning.Reading
  5. 20Enrich a streamA small lookup changes the meaning of a record.Lab
  6. 21Join changing streamsLatest values and all combinations answer different questions.Lab
  7. 22Count the join outputOne event can create more than one answer.Lab
  8. 23Look up the pastLatest context can rewrite yesterday.Lab
  9. 24When is a streaming answer final?Join horizons, corrections and changelog contracts.Reading
  10. 25Detect an event sequenceTwo failures followed by success is a stateful question.Lab
  11. 26Recognize sequences and absenceA missing event needs a clock, not only a predicate.Reading
Part 5

Failure, recovery and integration

Replay safely and recover state while handling retries and external writes.

  1. 27Replay without double countingOne order can have two deliveries.Lab
  2. 28Forget state deliberatelyA smaller state store changes the answers you can defend.Lab
  3. 29When is it safe to forget?State, timers, expiry and the meaning of a result.Reading
  4. 30Recover after a failureThe write succeeded. The offset did not.Lab
  5. 31What makes a snapshot consistent?A moving system needs a coordinated cut.Reading
  6. 32Exactly once—at which boundary?Replay is expected. Duplicate effects are a design choice.Reading
  7. 33Retry with a budgetTransient failure is a scheduling decision, not an infinite loop.Lab
  8. 34Connect transactions to streamsFollow an order from a database transaction to the broker and the consumer’s own database.Reading
Part 6

Performance and capacity

Measure work and latency, handle overload and plan recovery capacity.

  1. 35Measure operation effortCount the work before timing it.Lab
  2. 36Measure latency and batchingA higher throughput can hide a longer wait.Lab
  3. 37When the consumer falls behindA queue buys time. It cannot create capacity.Lab
  4. 38Where does the waiting go?Slow sinks, blocked channels and checkpoint cost.Reading
  5. 39Budget for recoveryNormal capacity is not recovery capacity.Lab
Part 7

Production delivery and governance

Backfill history, deploy changes and operate a streaming job.

  1. 40Run a bounded backfillReplay a declared range into a versioned destination.Lab
  2. 41Why did more workers not help?State migration and the limit of a single hot key.Reading
  3. 42What is the job waiting for?A diagnosis from source to visible result.Reading
  4. 43Test and deploy a changing streamA passing example is the beginning of a release contract.Reading
  5. 44Operate data with ownership and careSecurity, privacy and retention are part of the stream contract.Reading
Part 8

Design review and capstone

Review a streaming design, then investigate an incident.

  1. 45Defend the complete designCompose patterns, budgets and evidence into a production decision.Reading
  2. 46Resolve the streaming incidentOne pipeline. Several plausible explanations.Lab

Continue learning

Measure execution with the native performance guide, or explore request/reply and publish/subscribe in Messaging Patterns Lab →