Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Kafka message tweaking?

Tags:

apache-kafka

From https://data-flair.training/blogs/advantages-and-disadvantages-of-kafka/:

As we know, the broker uses certain system calls to deliver messages to the consumer. However, Kafka’s performance reduces significantly if the message needs some tweaking. So, it can perform quite well if the message is unchanged because it uses the capabilities of the system.

How can a message be tweaked? If I want to demonstrate that a message can be tweaked, what do I have to do?

like image 907
Snorlite Avatar asked Oct 26 '25 05:10

Snorlite


1 Answers

The suspected concern with Kafka performance is mentioned in this statement:


Suspicion:

Kafka’s performance reduces significantly if the message needs some tweaking. So, it can perform quite well if the message is unchanged


Clarification:

As a user of Kafka for several years, I found Kafka's guarantee, that a message cannot be altered when it is inside a queue, to be one of its best features.

Kafka does not allow consumers to directly alter in-flight messages in the queue (topic).

Message content can be altered either before it is published to a topic, or after it is consumed from a topic only.

The business requirement that needs messages to be modified can be implemented using multiple topics, in this pattern:

(message) --> Topic 1 --> (consume & modify message) --> Topic 2

Using multiple topics for implementing the message modification functionality will only increase the storage requirement. It will not have any impact on performance.

Kafka's design of not allowing in-flight modification of messages provides 'Data integrity'. This is one of the driving factors behind the widespread use of Kafka in financial processing applications.

like image 173
Gopinath Avatar answered Oct 29 '25 07:10

Gopinath