1.

Describe message compression in Kafka. What is the need of message compression in Kafka? Also mention if there are any disadvantages of it.

Answer»

Producers transmit data to BROKERS in JSON format in Kafka. The JSON format stores data in string form, which can result in several duplicate records being stored in the Kafka topic. As a result, the amount of disc space used increases. As a result, before delivering messages to Kafka, compression or delaying of data is performed to save disk space. Because message compression is performed on the producer side, no changes to the consumer or broker setup are required. 

It is advantageous because of the FOLLOWING factors:

  • It decreases the latency of messages transmitted to Kafka by reducing their size.
  • Producers can send more net messages to the broker with less bandwidth.
  • When data is SAVED in Kafka USING cloud platforms, it can save money in circumstances where cloud services are paid.
  • Message compression reduces the amount of data stored on disk, allowing for faster read and write operations.

Message Compression has the following disadvantages :

  • Producers must use some CPU cycles to compress their work.
  • Decompression takes up several CPU cycles for consumers.
  • Compression and decompression place a higher burden on the CPU.


Discussion

No Comment Found