Skip to content
skillbld
Day 8 of 14 30 minRetentionCompactionTombstones

Learn how long Kafka keeps events and how it removes them. Configure time- and size-based retention, see what happens to a consumer that falls too far behind, and use log compaction to keep only the latest value for each key, including deletes with tombstones.

By the end of today you can

  • Configure time-based and size-based retention
  • Explain why retention deletes whole segments, not single records
  • Predict what happens when a consumer's position has been deleted
  • Use log compaction to keep the latest value per key
  • Delete a key from a compacted topic with a tombstone

What's inside

  • 5 sections
  • 3 diagrams and mind maps
  • 5 code examples you can run
  • 5-question quiz
  1. 1Retention: delete old events
  2. 2When a consumer falls behind retention
  3. 3Compaction: the latest value per key
  4. 4Tombstones: deleting a key
  5. 5Choosing a cleanup policy

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 8: Retention & Compaction · Apache Kafka · SkillBld