Kafka Glossary and Core Concepts
masterUnderstanding the fundamental terminology used in Kafka and KafkaJS:
- Cluster: The collective group of machines running Kafka.
- Broker: A single Kafka instance.
- Topic: Used to organize data; all reads and writes occur to/from a specific topic.
- Partition: Data in a topic is spread across partitions. Each partition is an ordered log file. Only one member of a consumer group can read from a specific partition at a time.
- Producer: A client that writes data to Kafka topics.
- Consumer: A client that reads data from Kafka topics.
- Replica: Copies of partitions stored on different brokers to prevent data loss.
- Leader: The specific broker elected to handle all reads and writes for a particular partition.
- Consumer group: A collection of consumer instances identified by a
groupId. They work together to consume data from a topic. - Group Coordinator: An instance in a consumer group responsible for assigning partitions to members.
- Offset: A pointer to a specific position in a partition log. Consumers "commit" offsets to track progress.
- Rebalance: The process where a group coordinator reassigns partitions when consumers join or leave a group.
- Heartbeat: The mechanism (controlled by
heartbeatInterval) used by consumers to signal they are alive. If a consumer fails to send heartbeats within thesessionTimeout, it is considered dead and a rebalance is triggered.