The Desi Architect
Notes / Messaging and Correctness / Idempotency in Practice
Track 4 · Messaging and Correctness

Idempotency in Practice

The network will lose responses, clients will retry, brokers will redeliver. Idempotency is how you make sure the second attempt does not charge, book or send a second time. Keys, Postgres, Redis, consumers and webhooks, with the failure cases.

Guide22 min read
On this page
  1. The Pay button that was tapped twice
  2. The simple version
  3. A timeout is not a failure
  4. The key: who makes it, what it means
  5. Building it in Postgres
  6. The Redis shortcut, and where it bites
  7. Consumers: at-least-once means you will see it twice
  8. Side effects outside your database
  9. Webhooks: the other side of the same coin
  10. When retries meet a crowd
  11. Choosing the tool