awesome-everything RU
↑ Back to the climb

Backend Architecture

Idempotency and retries: free-recall review

Crux Free-recall prompts across the idempotency + retries unit. Answer each from memory first, then reveal the model answer and compare.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 14 min

Retrieval beats re-reading. For each prompt, reconstruct a full answer from memory before you open the model answer — the effort of pulling the mechanism back is what makes it stick under incident pressure.

Goal

Rebuild the unit’s spine without looking back: why exactly-once is an illusion, the four-state key machine, full jitter and retry budgets, the outbox + inbox composition, the concurrency fix, and the observability that turns belief into evidence.

Recall before you leave
  1. 01
    Why is exactly-once delivery an illusion, and how does the unit deliver effectively-once instead?
  2. 02
    Walk the four states the server resolves an Idempotency-Key into, with the status code for each.
  3. 03
    Why does the request fingerprint matter alongside the key, and what fails silently without it?
  4. 04
    Give the full-jitter backoff formula, explain why jitter is non-negotiable, and say why a per-request retry cap is not enough.
  5. 05
    Why does any 'write DB then publish to broker' design fail, and how do outbox + inbox fix it?
  6. 06
    Two concurrent requests share an idempotency key. Why is SELECT-then-INSERT unsafe, and what is the production-grade store?
Recap

If you reconstructed each answer, you hold the unit’s spine: exactly-once is an illusion, so you build effectively-once from at-least-once plus dedup; one key per operation resolves to new / 409 / replay / 422, with the fingerprint guarding against silent loss; retries use full jitter, honour Retry-After, retry only 5xx, and live under a fleet retry budget; the dual-write is closed by outbox atomicity plus an at-least-once relay plus an idempotent inbox; concurrent key creation is made atomic with ON CONFLICT DO NOTHING RETURNING; and the durable store must survive a crash because a lost key is a double charge.

Continue the climb ↑Idempotency and retries: code and query reading
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.