Log compaction retains only the most recent value for each key. Older duplicates are removed.
Use cases:
- Database changelog (CDC)
- User profile updates
- Configuration state
How it works:
Background cleaner identifies keys with multiple entries. Removes all but the latest. Tombstone (null value) marks deletion.
Configuration:
cleanup.policy=compact
Compacted topics act like a key-value store backed by a log. Consumers starting from beginning see current state.