Kafka Log Compaction Explained (and Backing It Up)
Kafka log compaction keeps the latest value for each key in a partition. Older values for that key can be removed. The record that stays is the current state, not the full change history.
Apache Kafka 4.4 describes this on the log compaction page. Topic settings are on the topic configs page. Broker defaults are on the broker configs page.
Kafka log compaction retains the latest value for each key. The log cleaner drops older duplicates in closed segments. A tombstone is a key with a null value, kept for delete.retention.ms (default 1 day), then removed. A backup copies that log, not values the cleaner already dropped.