Try
↑ ↓ move↵ openesc close

Interview prep / Delivery guarantees

Senior · Delivery guarantees · System design interview question

Compare making a consumer idempotent with committing the result and the read position in one transaction. When would you choose each?

Sketch your own answer first, then compare it with the one below.

A strong answer

An idempotent consumer works with any at-least-once source and any target that can recognise a repeat, by key or by an operation like "set to this value". It is simple and portable. It needs a key, a store, and care about expiry.

A transactional commit saves the result and the offset together, so a failure leaves neither. It gives a clean effectively-once result without keys, but it needs a target and a source that can share a transaction or a checkpoint, which limits where it applies.

Choose idempotence for effects on external systems and for mixed technologies. Choose the transaction when the output stays inside one store you control. Either way, the guarantee ends at the system boundary.

Sources

Learn it by running it

The delivery guarantees lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms