System Design · interactive
Idempotency and request deduplication
Networks lose responses. When that happens the client can't know whether the payment went through, so it retries. Without a way to spot the retry, the customer pays twice.
Client
Network
Payment server
- client
POST /charge $50
Card statement
- nothing yet
Idempotency keys stored
- not used
POST /charge $50 The client sees: waiting…
Request
Step 1 of 4 · read left to right
In production
Tools and technologies
Payment and messaging APIs accept idempotency keys so clients can retry safely.
Not tied to one language — use these names when you search docs or design a system.
- Stripe idempotent requestsService
Send Idempotency-Key and Stripe replays the first result for 24 hours.
Official site ↗ - IETF Idempotency-Key headerStandard
Draft standard for the header and its error codes.
Official site ↗ - AWS Lambda Powertools idempotencySoftware
Store keys and results in DynamoDB around a handler.
Official site ↗