Book 2 · Lesson 2.2

Kafka topics, partitions, and offsets

  • Define topic, partition, and offset
  • Relate millipede topic names to services
  • Simulate produce and offset rewind per partition

Prerequisites: 2.1

Kafka is the append-only log between services.

Core vocabulary

TermMeaning
TopicNamed stream (raw-dev-events)
PartitionOrdered sub-log — parallel consumers
OffsetMonotonic index within a partition

KafkaTopicExplorer — switch topics, pick partition P0–P2, produce messages.

Millipede topics

Axum Ingestionraw-dev-events
Python LLM Workerenriched-dev-events
Rust AnalyzerPostgres + Redis
SolidJS Dashboardlive metrics
TopicProducerConsumer
raw-dev-eventsingestionllm-worker
enriched-dev-eventsllm-workeranalyzer

Teach-back prompt

Why use a partition key like team_id?

Docker Compose Kafka

Lesson 2.2 check

1. Offsets are scoped to…