Skip to main content
PreparationZone Logo
PrepZone

Retention, Compaction, and Tombstones

Time-based retention vs log compaction for VaultCommerce customer profile changelog topics.

Pass checkpoint below

Why this matters

  • VaultCommerce order events use 7-day delete retention; customer profiles use compaction.
  • Tombstones (null values) delete keys in compacted topics after delete.retention.ms.
  • Wrong policy fills disks or loses replay history.
  • Compaction underpins Kafka Streams state store changelog topics.
Retention (orders)
7-day deleteTime-based
Compaction (profiles)
Latest per keyTombstone deletes
Delete policy drops old segments by time. Compact policy keeps the latest value per key.

Time and size retention

retention.ms=604800000 (7 days) on order topics — enough for replay and incident recovery. retention.bytes caps per-partition size as safety valve. VaultCommerce never relies on retention alone for compliance deletion — PII scrubbing happens in consumers.

Key points

  • cleanup.policy=delete — time/size based segment removal
  • cleanup.policy=compact — key-level retention of latest value
  • Tombstone — record with null value signaling key deletion
  • delete.retention.ms — how long tombstones survive before purge
  • Compacted changelog — backing topic for Kafka Streams state stores

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 2 sections

  • Log compaction
  • VaultCommerce rollout checklist

Test yourself

Answer these before moving on — recall is what makes it stick.