Patterns for Apache Kafkas
Kafka event-driven patterns are design approaches for building systems around events. They include event notification, event-carried state transfer, event sourcing, CQRS, the outbox pattern for reliable publishing, and sagas for multi-service workflows, each trading simplicity against consistency and traceability.
Stage: Stream Processing · Part of the Apache Kafka roadmap · Last reviewed 19 November 2026
What to learn in Patterns
- Describe event sourcing and how state is rebuilt from events
- Implement the transactional outbox pattern to avoid dual writes
- Explain how CQRS separates read models from write models
- Design a saga with compensating actions for a failed step
- Handle poison messages with retries and a dead-letter topic
Patterns interview questions
What problem does the outbox pattern solve?
Updating a database and publishing a Kafka message are two writes that cannot be one atomic transaction, so one can succeed while the other fails. With the outbox pattern, the service writes the event into an outbox table in the same database transaction, and a separate process publishes it to Kafka.
What is a dead-letter topic?
A dead-letter topic holds messages that a consumer could not process after retries, usually because they are malformed or hit a persistent error. Moving them aside keeps the main stream flowing and lets you inspect, fix and replay the failed messages later.
Where Patterns fits in the Apache Kafka roadmap
Patterns belongs to the Stream Processing stage (intermediate level). Compute on streams.
Other units in this stage
Back to the full Apache Kafka roadmap