Integration / Apache Kafka Interview questions
What is the difference between at-least-once, at-most-once, and exactly-once delivery semantics?
These describe what a consumer can be guaranteed about duplicate or missed processing, and the difference comes down entirely to when offsets are committed relative to when the message is actually processed.
| At-most-once | At-least-once | Exactly-once |
| Commit offset BEFORE processing. | Commit offset AFTER processing. | Producer writes and offset commit happen atomically via transactions. |
| A crash after commit but before processing means the message is silently lost. | A crash after processing but before commit means the message is reprocessed. | No loss and no duplicate processing, even across a crash. |
| Simplest, lowest overhead, rarely used for anything that matters. | Most common default; requires idempotent downstream processing to handle duplicates safely. | Highest overhead and setup complexity, but strongest guarantee. |
Exactly-once in Kafka specifically means exactly-once within Kafka's own read-process-write cycle (using idempotent producers and transactions) — if the processing step also writes to an external system outside Kafka's transactional boundary, that external write still needs its own idempotency handling to preserve the same guarantee end to end.
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...
