Nag
Nag

Reputation: 2057

Kafka - Sequential I/O

I am going through some of the articles to better understand what could be the reasons why Kafka is faster compared with other Messaging systems

One of the reasons apart from Zero On Copy , is Sequential IO - this sounds exciting. However, some follow up question wrt it.

Upvotes: 1

Views: 1035

Answers (1)

JavaTechnical
JavaTechnical

Reputation: 9357

In Kafka, we generally seek offset during the consumer startup and every poll after that reads messages one after the other sequentially.

So, if seeking to an offset is random, it happens only during the startup and not afterwards i.e. it is only once. Subsequent polling is always sequential. So, it is only sequential access afterwards.

You may for example call seek() in your program multiple times but that is not what is used atleast in production. Because for getting records, you may any way have to poll() which always reads messages sequentially from the given offset.

Upvotes: 1

Related Questions