Kafka events को retain करता है एक configurable अवधि (या size) के लिए, उन्हें consumption के बाद भी partition logs में रखते हुए — replay और कई consumers को सक्षम बनाते हुए। retention और log management को समझना Kafka का उपयोग करने और storage प्रबंधित करने के लिए महत्वपूर्ण है।
Retention — events रखे जाते हैं
Unlike traditional queues, Kafka RETAINS events (doesn't delete on consumption):
→ events stay in the partition log for a configured RETENTION period (e.g. 7 days) or
SIZE limit
→ enables: REPLAY (re-read history), multiple consumers reading independently, late
consumers catching up
→ after retention expires → old segments are deleted (or compacted)
→ Kafka is a durable LOG, not just a transient queue
