apache-kafkakafka-topickafka-partition

Does the same Kafka partitions of the same topic on different brokers contains the same messages ( duplicate each other)?


Broker 1:

+-------------------+
|      Topic 1      |
|    Partition 0    |
|                   |
|                   |
|     Topic 2       |
|   Partition 1     |
+-------------------+
Broker 2:

+-------------------+
|      Topic 1      |
|    Partition 2    |
|                   |
|                   |
|     Topic 2       |
|   Partition 0     |
+-------------------+
Broker 3:

+-------------------+
|      Topic 1      |
|    Partition 1    |
|                   |
|      Topic 1      |
|    Partition 2    |
|                   |
+-------------------+

So does Broker 1 Topic 1 Partition 1 contains the same as Broker 3 Topic 1 Partition 1


but Broker 3 Topic 1 Partition 1 contains the different as Broker 3 Topic 1 Partition 2

?


Solution

  • The short answer is YES. The same partition is identical on all brokers. Different partitions contain different messages.

    However, Kafka is a moving system, so not everything is aligned all the time. It depends on the producer's 'ack' value, network throughput & partitioning, and many other factors.