Kafka medium
For 'Keyless' messages, modern Kafka Producers utilize the 'Sticky Partitioner' instead of pure Round-Robin. What is the performance driver for this change?
- A It ensures that all messages for the whole day go to Partition 0 to save disk space.
- B Batch Efficiency: By sticking to one partition until a batch is full (or timed out), the producer can significantly reduce network requests and improve compression ratios compared to spreading small, individual messages across all partitions.
- C It encrypts the partition ID to prevent eavesdropping.
- D It forces the broker to use SSD storage for that specific batch.
Answer: B. Batch Efficiency: By sticking to one partition until a batch is full (or timed out), the producer can significantly reduce network requests and improve compression ratios compared to spreading small, individual messages across all partitions.
If you have 100 partitions and 100 messages, pure Round-Robin sends 100 tiny network requests. Sticky partitioning sends 1 request with 100 messages (all for Partition 1). This 'stickiness' results in a 10x+ improvement in throughput for keyless workloads.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When implementing 'Exactly-Once Semantics' (EOS) in a Kafka stream, what is the role of the `isolation.level=read_committed` setting on the Consumer?
- Historically, which external service was required by Kafka to manage cluster hierarchy, metadata, and leader election status?
- Once a message is successfully appended to a Kafka partition log, what is its mutability status?
- In a Kafka cluster, what is the role of a 'Broker'?
- What is the primary indicator of a bottleneck in a Kafka consumer's processing logic?
- What is the primary architectural role of Apache Kafka in a distributed system?