What are the core components of Kafka?
Answer
Kafka consists of several core components. Broker: a Kafka server that stores messages and serves producer/consumer requests. A Kafka cluster is a group of brokers. Topic: a named category/feed to which records are published. Analogous to a table in a database. Partition: a topic is divided into partitions for parallelism and scalability. Producer: a client that publishes (writes) messages to a topic. Consumer: a client that subscribes to topics and reads messages. Consumer Group: a group of consumers that jointly consume a topic, with each partition assigned to exactly one consumer in the group. ZooKeeper (legacy): managed cluster metadata. KRaft (modern): Kafka's built-in metadata consensus, replacing ZooKeeper. Offset: an integer identifying a message's position within a partition.