InterviewSolution
| 1. |
What do you mean by a Partition in Kafka? |
|
Answer» Kafka TOPICS are separated into partitions, each of which contains records in a fixed order. A unique offset is assigned and attributed to each record in a partition. Multiple partition logs can be found in a single topic. This ALLOWS several users to read from the same topic at the same time. Topics can be parallelized via partitions, which split DATA into a single topic among numerous brokers. Replication in Kafka is done at the partition LEVEL. A replica is the redundant element of a topic partition. Each partition often contains one or more replicas, which means that partitions contain messages that are duplicated across many Kafka brokers in the cluster. One SERVER serves as the leader of each partition (replica), while the others function as followers. The leader replica is in charge of all read-write requests for the partition, while the followers replicate the leader. If the lead server goes down, one of the followers takes over as the leader. To disperse the burden, we should aim for a good balance of leaders, with each broker leading an equal number of partitions. |
|