Topics / 🔀 Pipelines & Data Engineering Patterns / 🔀 Level 28: Pipelines & Streaming

Quiz · about 2 minutes · free

Why Key the Stream?

Two kills and a death arrive for Kai. Order matters.

Kafka only guarantees ordering within a partition, not across partitions.

Diagram. events (key = player); partition 0 (Mia, Zed); partition 1 (Kai: kill → death → loot); partition 2 ((empty)). Links: events → partition 0; events → partition 1; events → partition 2. same key → same partition → order is kepteventskey = playerpartition 0Mia, Zedpartition 1Kai: kill → death → lootpartition 2(empty)same key → same partition → order is kept
Why partition game events by player ID in Kafka?
  1. It makes old events expire sooner
  2. It encrypts the data
  3. Events for one player stay together and in order
  4. It compresses the messages

Answer it interactively → Free. Sign in with Google to run it. Your code runs on your device.

In this level you'll learn:
More in Level 28: Pipelines & Streaming

Share on LinkedIn