Skip to content

Idempotency

Why a lost acknowledgement makes every retry a possible duplicate, and how idempotency keys, atomic recording and retention turn at-least-once into exactly-once effects.

25 min7 steps

By the end you can
  • Explain why a timeout cannot reveal whether an operation happened, and estimate the duplicates a naive retry causes
  • Distinguish naturally idempotent operations from ones that need deduplication
  • Design an idempotency-key flow that records the key and the effect atomically, and size its retention and storage

The lost acknowledgement

ClientPaymentscharge $50✕ok (charged)retry: charge $50ok (charged again)
Networks give at-most-once or at-least-once. Exactly-once effects are something you build.

Loading question…

Answer this step to continue.