A Kafka topic normally forgets by age: keep seven days, discard the rest. That is right for events and wrong for state. If a topic carries customer 8842's current address, deleting it after a week means the address is gone. Keeping everything forever means replaying millions of superseded updates to learn one current value.
Log compaction forgets by key instead. It keeps the most recent value for every key and discards the older ones, so a topic holding five records across three keys ends up holding three.
That turns a history into a table. A new consumer reads the compacted topic from the beginning and rebuilds the full current state in bounded time — which is how a cache warms on startup, how a service recovers after a crash, and how configuration reaches every instance.
Two details bite. Compaction runs asynchronously, so duplicates exist until it has run; consumers must always take the last value for a key rather than the first. And deletion needs a tombstone — a record carrying the key and a null value, which compaction then removes entirely.
What we choose to forget defines what the thing we built actually is.
