What is
Kafka
?
Apache Kafka is an open-source distributed event streaming system. It publishes, subscribes to, durably stores and processes streams of events across a cluster of servers.
At a glance
Attribute | Value |
|---|---|
Primary use case | Distributed event streaming for data pipelines, streaming analytics and data integration |
Deployment type | Self-managed on bare metal, VMs or containers, on-premises or cloud; fully managed services from various vendors |
Pricing model | Free, open source (Apache License 2.0) |
API compatibility | Admin, Producer, Consumer, Kafka Streams and Kafka Connect APIs (Java, Scala); community clients and REST APIs; TCP protocol |
Supported integrations | Hundreds of connectors, including Postgres, JMS, Elasticsearch, AWS S3 |
Source type | Open |
Key metrics | Vendor-reported: more than 80% of Fortune 100 companies use Kafka; more than 5 million unique lifetime downloads; clusters up to a thousand brokers |
AEP branch | Tooling |
AEP category | Resources |
AEP subcategory | Messaging |
Profile
Kafka is a distributed system of servers and clients that communicate over a TCP network protocol. The servers run as a cluster, and the servers called brokers form the storage layer. Each event has a key, value, timestamp and optional headers, and is stored in a topic. Topics are partitioned across brokers so clients can read and write from many brokers at once. Events with the same key go to the same partition. Producers and consumers are fully decoupled, so producers never wait for consumers.
Focus
Kafka serves teams that build data pipelines, streaming analytics, data integration and event-driven architectures or microservices. Typical uses include real-time payment processing, fleet and shipment tracking, IoT sensor analysis and connecting data across company divisions.
Background
Apache Kafka is a project of The Apache Software Foundation and is licensed under the Apache License 2.0.
Features
Producer and Consumer APIs
Producers publish streams of events to one or more topics, and consumers subscribe to topics to read and process them. Any topic can have many producers and many consumers.
Kafka Streams
A library for building stream processing applications and microservices. It supports transformations, aggregations, joins, windowing and event-time processing, reading from input topics and writing to output topics.
Kafka Connect
Runs reusable connectors that continuously import and export event streams between Kafka and external systems, such as capturing every change to PostgreSQL tables.
Replication and multi-region clusters
Topic partitions are replicated across brokers, even across datacenters or geo-regions. Clusters can stretch over availability zones or connect separate clusters across regions, keeping data available during failures or maintenance.
Admin API and command-line tools
The Admin API and command-line tooling manage and inspect topics, brokers and other Kafka objects.
Pros and cons
Pros
One system covers publishing, durable storage and real-time or retrospective processing of event streams end to end.
Consumers can re-read events as often as needed because events are not deleted after consumption. Kafka says performance stays constant as data grows.
Kafka says consumers always read each partition's events in the order they were written, and it supports exactly-once processing.
Clients are available for Java, Scala, Go, Python, C/C++ and many other languages, plus REST APIs.
Cons
Self-managed clusters of brokers and Connect servers are operated by the team. A fully managed option means choosing a separate vendor's service.
The five core APIs are for Java and Scala. Other languages rely on clients provided by the Kafka community.
FAQs
What is Apache Kafka?
Apache Kafka is a distributed event streaming system. It lets applications write, read, store and process streams of events on a cluster of servers.
How is Kafka licensed and what does it cost?
Kafka is open source under the Apache License 2.0, so it is free to use and modify.
Can Kafka be self-hosted?
Yes. Kafka can run on bare-metal hardware, virtual machines or containers, on-premises or in the cloud. Teams can operate it themselves or use fully managed services from a variety of vendors.
Which programming languages does Kafka support?
Some clients ship with Kafka, and the community adds dozens more. Together they cover Java and Scala (including the Kafka Streams library), Go, Python, C/C++ and other languages, as well as REST APIs.
How does Kafka connect to other systems?
Kafka Connect imports and exports data between Kafka and external systems. Hundreds of ready-to-use connectors exist, for example for Postgres, JMS, Elasticsearch and AWS S3.
What delivery guarantees does Kafka provide?
According to the project, Kafka guarantees per-partition ordering for consumers, supports exactly-once processing and provides zero message loss for mission-critical use cases.
