Sobes.tech
Senior

Does Kafka topic have FIFO property?

sobes.tech AI

Answer from AI

In Kafka, a topic does not guarantee the global FIFO (First In, First Out) property for all messages, but it ensures order within each partition of the topic.

That is:

  • Messages within a single partition are written and read strictly in the order they arrive, ensuring FIFO at the partition level.
  • However, a topic usually consists of multiple partitions, and there is no guarantee of order between them. Messages in different partitions can be processed in parallel and arrive in arbitrary order.

If strict FIFO for the entire topic is required, usually a single partition is used, but this limits scalability and throughput.

Thus, Kafka guarantees FIFO only within a partition, not for the entire topic.