Apache Kafka
Apache Kafka is a distributed event streaming platform, developed at LinkedIn and later donated to the Apache Software Foundation. It acts as a durable, high-throughput backbone for data in motion: producer applications publish events — an order placed, a page viewed, a sensor reading — and consumer applications process those events asynchronously, each at its own pace. Unlike a conventional message broker, Kafka does not delete a message once it is read; events stay in the log for a configurable retention window and can be replayed at will.
How Apache Kafka works
Kafka organizes events into topics, and each topic is split into partitions — ordered, append-only logs in which every record receives a sequential offset. Partitions are spread across multiple broker servers forming a cluster, and each partition is replicated to several brokers, so losing one machine loses no data. On the reading side, consumers join consumer groups: the partitions of a topic are divided among group members, which makes horizontal scaling trivial — add a consumer, and Kafka rebalances the workload. Because each group tracks its own offsets, a service can crash, restart and resume exactly where it stopped, or deliberately rewind to reprocess past events. Modern Kafka runs in KRaft mode, managing its own metadata without the historical ZooKeeper dependency.
Practical application
Kafka shows up wherever systems need to exchange large volumes of events without tight coupling:
- Microservice integration — services publish domain events instead of calling each other directly, so one slow component never blocks the rest;
- Log and metrics pipelines — events from hundreds of hosts flow into one stream and fan out to systems like Elasticsearch or a data lake;
- Stream processing — real-time fraud detection, counters and enrichment with Kafka Streams or Flink;
- Change data capture — Kafka Connect mirrors database changes into analytics platforms.
Operationally, Kafka rewards fast storage and a reliable network: production clusters typically run at least three brokers on NVMe-backed machines so replication can do its job. For development or low-volume workloads, a single broker on a modest VPS is perfectly sufficient.
Powiązane pojęcia
Najczęstsze pytania
How is Kafka different from a traditional message queue?
A traditional queue deletes each message once a worker acknowledges it. Kafka keeps events in a durable log for a configured retention period, so multiple independent consumers can read the same stream and even replay history. Queues excel at routing individual jobs; Kafka excels at high-throughput streams and reprocessing.
