Integration / Apache Kafka Interview questions
What is the purpose of a Kafka topic's retention policy?
A retention policy determines how long Kafka keeps records in a topic before they're eligible for deletion, since a topic's log can't grow forever on finite disk space. It's configured per topic, most commonly by time (retention.ms) or by size (retention.bytes), whichever limit is hit first.
retention.ms=604800000 # 7 days retention.bytes=-1 # no size-based limit
The purpose is to balance durability against storage cost: a topic feeding real-time processing might only need a few hours or days of retention since consumers are expected to stay caught up, while an event-sourcing or audit-log topic might retain data for months or indefinitely. Retention is independent from whether a message has already been consumed — Kafka doesn't delete a record just because every consumer has read it, so multiple consumer groups can each re-read historical data within the retention window at their own pace.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
