System Design ($200k+) · RELIABILITY · Distributed Systems Core · 2026

Client Idempotency Key vs Blind HTTP Retry on Timeout

Quick Decision Rule: When A mobile checkout client retries a POST /charge call after a 504 Gateway Timeout while the upstream payment processor may have already succeeded, choose Client-generated Idempotency-Key persisted in a unique DB constraint storing the first committed response.

Trigger ConditionA mobile checkout client retries a POST /charge call after a 504 Gateway Timeout while the upstream payment processor may have already succeeded
Recommended ChoiceClient-generated Idempotency-Key persisted in a unique DB constraint storing the first committed response
Classic TrapBlindly retrying non-idempotent POST writes causes duplicate customer charges; retries without server-side idempotency turn network glitches into financial incidents.
VerificationAudited on 2026-11-23 · Distributed Systems Core · 2026

30-SECOND DECISION TRAP CHECK · RELIABILITY

Test your instinct

Users report being double-charged on flaky mobile networks after an engineer added automatic 3x client retries on HTTP 504 timeouts for `POST /v1/payments`. What is the missing safeguard?

Primary Engineering Documentation

Related Reliability Decision Guides