liveBook · Manning

Compacted topic

A compacted topic is a Kafka topic whose log compaction retains the latest record for each key while allowing obsolete records to be removed.

How 2 Manning books explain it

Kafka for Architects

A compacted topic is a Kafka topic configured to retain at least the latest record associated with each non-null key.

How it is used
Stores recoverable current state for keyed configuration, profiles, changelogs, balances, or prices.
How deep it goes
Explains retention semantics, key partitioning, sequential reads, delayed cleanup, and consumer-visible older records.
Examples
Uses account balances, customer profiles, configuration data, changelogs, and current product prices.
What you can do after
Operate/configure a topic for current keyed state while evaluating sequential replay, delayed cleanup, and storage trade-offs.

Read how Kafka for Architects explains compacted topic →

Kafka Streams in Action, Second Edition

A compacted topic is a Kafka topic whose log retains the latest record for each key rather than retaining every historical record indefinitely.

How it is used
Supports retaining recoverable latest state for keyed event streams and Kafka Streams state-store changelogs.
How deep it goes
Explains key-based cleanup, background log cleaning, configuration, tombstones, and combined policies, while deferring broader compaction details.
Examples
Uses stock ticker prices, duplicate keyed updates, tombstones, and a Kafka Streams changelog configuration.
What you can do after
Configure Kafka topics with compaction and choose tombstones or combined cleanup policies for keyed state retention.

Read how Kafka Streams in Action, Second Edition explains compacted topic →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.