Broker
A Kafka broker is a server that stores and serves data. Typically, a Kafka cluster consists of multiple brokers to handle large scale and to provide fault tolerance.
Topics
A topic is a logical grouping of messages. Messages are sent from a producer and read by a consumer.
Partition
A partition is a way to divide a topic’s messages. Each partition is an ordered sequence of messages. By splitting a topic into partitions, it allows multiple consumers to read messages simultaneously. Partions are a fundamental way to enable parallelism. Messages are distributed between topics in two ways
- Key-based partitioning: If a key is provided, Kafka uses the key to determine the partition
- Round-Robin: If there is no key, messages are distributed evenly between the partitions.
Producer
Service that writes messages to Kafka topics.
Consumer
Service that reads messages from a given Kafka topic, to ensure messages ordering the services is single threaded. Usually, a consumer is part of a consumer group to enable parallel processing of messages. A consumer can have an optional Client Id, it is used for identification, logging, and monitoring.
Consumer Group
A consumer group is a collection of consumers that work together to read messages from a Kafka topic. Consumer groups enable parallel processing by having each consumer read messages from one partition, hence, guaranteeing messages ordering.
Message
A message consists of
- A key, which is optional, used for partitioning
- Data payload
- Timestamp, when the record was created
Offset
The offset is a unique identifier for each message within a partition, the offset represents the message positions in the partition. Consumers use offsets to keep track of their position with a topic’s partition, this ensures that messages are not reprocessed. Consumers can commit their offsets either automatically or manually.


