Idempotency
Making an operation safe to repeat, because a client that times out cannot know.
5 to work through
-
intermediate Multiple choice
A marketplace checkout calls a payment API. Mobile clients on poor networks time out and retry, and some customers are charged twice. Where exactly must the deduplication record be written for this to be fixed?
2 min answer -
advanced Multiple choice
A billing platform sends a webhook, the customer's endpoint times out, and the customer's system retries the operation several times. How should idempotency keys, durable event state, delivery attempts, ordering and reconciliation prevent duplicate billing?
2 min answer -
advanced
A payments API receives the same charge request twice because a mobile client retried after a timeout. How should idempotency keys be scoped, stored, expired and validated, and what happens when the first attempt is still in flight?
2 min answer -
advanced
An API platform sends messages on behalf of external developers whose clients retry aggressively after network timeouts. Design idempotency so that a retried request never sends a second message - and state precisely where the guarantee begins and ends.
2 min answer -
advanced Multiple choice
Mobile clients on poor networks retry payment requests after timeouts. Where must idempotency be enforced, what must be durable before responding, and what is the most common scoping mistake?
2 min answer
3 terms in this topic
Idempotency
The property that performing an operation twice has the same effect as performing it once — the only practical defence against the duplicates a retry…
practiceIdempotency Key Scoping
The decision of what an idempotency key is unique within, what is stored alongside it, and how long it lives - the three choices that determine wheth…
patternIdempotency Token Store
The durable record of which idempotency keys have been seen and what each one returned, and the component that decides whether the guarantee is real.
Neighbouring topics
Distributed Systems
General material on partial failure, coordination and distributed reasoning.
CAP & PACELC
What you must give up during a partition, and the latency choice the rest of the time.
Consistency Models
Linearizable, sequential, causal, eventual, and the session guarantees between them.
Retries & Backoff
Exponential backoff, jitter, retry budgets, and how retries become the outage.
Timeouts & Deadlines
Per-hop timeouts that do not compose, and the deadline budget that replaces them.
Circuit Breakers
Failing fast on a broken dependency, and what you fail fast to.
Backpressure & Flow Control
Telling callers to slow down instead of buffering into congestion collapse.
Load Shedding
Rejecting some work deliberately so the rest can be served correctly.
Bulkheads & Isolation
Partitioning resources so one dependency cannot starve the others.
Leader Election
Agreeing who is in charge, and fencing the one who no longer is.
Consensus Protocols
Raft, Paxos and quorums — what they guarantee and what they cost.
Distributed Locking
Mutual exclusion across machines, and why it is harder than it looks.
Distributed Transactions
Two-phase commit, its blocking failure mode, and when it is still reasonable.
Sagas & Compensation
Replacing atomicity with semantic undo, and ordering the irreversible steps last.
Service Discovery
Finding a healthy address for something whose instances are ephemeral.
Messaging & Queues
Decoupling producer from consumer, and the semantics that come with it.
Event Streaming
Retained ordered logs, consumer offsets, partitions and replay.
Clocks & Ordering
Why wall clocks lie, and how logical clocks and versions restore order.
Failure Modes
Slow rather than down, partial, grey, and failing while reporting success.