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
- The Pay button that was tapped twice
- The simple version
- A timeout is not a failure
- The key: who makes it, what it means
- Building it in Postgres
- The Redis shortcut, and where it bites
- Consumers: at-least-once means you will see it twice
- Side effects outside your database
- Webhooks: the other side of the same coin
- When retries meet a crowd
- Choosing the tool