Batching (raggruppament ta' messaġġi) u compression (kompressjoni tad-data) huma tekniki ewlenin għal throughput għoli ta' Kafka — billi jitnaqqsu l-overhead per-messaġġ u l-kosti tan-network u tal-istorazzjoni. Il-fehim tagħhom jgħin biex tintlaħaq il-performance għolja ta' Kafka.
Batching — raggrupp messaġġi
BATCHING → the producer groups multiple messages into a single BATCH before sending:
→ fewer, larger requests instead of many tiny ones → much higher THROUGHPUT (less
per-request overhead, fewer network round-trips)
→ controlled by: batch.size (batch size limit) + linger.ms (wait time to accumulate a batch)
→ trade-off: slightly higher LATENCY (waiting to batch) for much higher throughput
→ batching is essential for high-throughput producing
