Try
↑ ↓ move↵ openesc close

Interview prep / Delivery guarantees

Junior · Delivery guarantees · System design interview question

Why does the order of "do the work" and "ack" matter?

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

A strong answer

The ack tells the broker to forget the message. If you ack first and crash before the work, the message is gone and the work never happens. If you work first and crash before the ack, the broker redelivers and the work happens again.

So the order picks which failure you accept: loss or repetition. The broker cannot tell a crash before the work from a crash after it, because both look like a missing ack.

Most systems choose repetition, then make the work safe to repeat.

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