Kafka medium
If you set `cleanup.policy=compact` on a Topic, what is the impact on long-term data retention?
- A The cluster will utilize 'Zero-Copy' logic to move all data directly to a cold S3 bucket after 7 days.
- B Every message is automatically encrypted with a rotation-friendly key.
- C Kafka ensures that for every unique record key, the *latest* value is preserved; older versions of that key are eventually purged during background log cleaning.
- D Data is deleted strictly after 100MB of log data has been written, regardless of keys.
Answer: C. Kafka ensures that for every unique record key, the *latest* value is preserved; older versions of that key are eventually purged during background log cleaning.
Log Compaction is ideal for 'State' storage (like a database table). If a user changes their address 5 times, a compacted topic will eventually only store the 5th address, saving disk space while allowing new consumers to 'boot' their state by reading the latest snapshots.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When implementing 'Exactly-Once Semantics' (EOS) in a Kafka stream, what is the role of the `isolation.level=read_committed` setting on the Consumer?
- Historically, which external service was required by Kafka to manage cluster hierarchy, metadata, and leader election status?
- Once a message is successfully appended to a Kafka partition log, what is its mutability status?
- In a Kafka cluster, what is the role of a 'Broker'?
- What is the primary indicator of a bottleneck in a Kafka consumer's processing logic?
- What is the primary architectural role of Apache Kafka in a distributed system?