Retries are inevitable; design as if every call may run twice.
Idempotency and Retries: retries are inevitable
turn boundaries into contracts
Keys must be globally unique per operation.
Idempotency means doing the same operation N times has the same effect as doing it once. For safe verbs (GET) it's natural; for POST/charge/send-email, it's a deliberate design choice with idempotency keys.
Server stores key → result for a TTL; replay returns the same response.
Retries: jittered exponential backoff to avoid thundering herd.
Combine with at-least-once delivery from queues — every consumer must be idempotent.
Charge endpoint must not double-bill.