Build an Idempotency-Key Store

request fingerprints and replay

Challenge 4 of Async & MessagingIntermediate~40 min

Make retries safe. Build the mechanism that stops a double-clicked 'Pay' button from charging twice: cache a response by its idempotency key and replay it, reject a key reused with a different request, expire keys after a TTL, and scope keys per user so they never collide.

4 steps

  1. 1Store and Replay
  2. 2Request Fingerprints
  3. 3Expiring Keys
  4. 4Scoping Keys
Start step 1