What are some common use cases for Apache Kafka?
Instruction: Describe typical scenarios where Kafka is effectively used.
Updated
Official answer
Kafka is useful when several systems need a durable, replayable stream and can process it independently. Typical uses include:
- Event integration: an order service emits changes that billing, fulfillment and analytics consume through separate groups.
- Change-data capture: a connector transports database changes to projections or analytical systems, with an explicit snapshot/stream handoff and recovery contract.
- Stream processing: applications compute keyed aggregates, join event streams or maintain materialized views.
- Telemetry and log pipelines: producers buffer events for downstream indexing or analysis while consumers manage their own progress.
- Feature and analytics pipelines: events feed model features or reporting, with controls for event time, late data and schema changes.
Kafka may also be part of an event-sourced system, but ordinary retention and compaction do not create a permanent immutable audit trail. The business must define authoritative event history, replay, deletion, access and archival requirements separately.
For each use case, specify latency, throughput, ordering, retention, failure handling and operating cost. A simple task queue, request/response API or database may be a better fit when replay and independent stream consumers add little value.
Kafka concepts and applications, Kafka Connect, Kafka Streams