Describe the architecture of Kafka.
💡 Model Answer
Kafka is a distributed commit log that stores streams of records in categories called topics. Each topic is split into partitions, which are ordered, immutable sequences of records. A broker hosts one or more partitions; each partition has a leader and zero or more followers for replication. Producers write records to the leader of a partition, and consumers read from the leader, maintaining an offset to track progress. The cluster is coordinated by ZooKeeper (or the newer KRaft mode) to elect a controller, manage metadata, and handle leader elections. Kafka stores data on disk in a log format, enabling high throughput and low latency. Consumers can be part of consumer groups, allowing load‑balanced consumption and fault tolerance. Kafka also supports features like log compaction, retention policies, and security via SSL/TLS and SASL. The architecture’s key strengths are horizontal scalability, fault tolerance through replication, and the ability to handle high‑volume, real‑time data streams.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.
Get Assisting AI — Starts at ₹500