System Design · Senior · Question 6 of 75

Why must consumers of an "at-least-once" queue be idempotent?

Explanation

Exactly-once is expensive or unattainable in practice, so systems guarantee "at least once". The handler stores ids of processed messages or makes operations idempotent (upsert instead of insert).

Further reading

Problem with a question

System Design · Senior · question 6

Test yourself

Take the System Design · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz