Menu

1 / 3

Idempotency at Scale: The Pattern That Prevents Double-Charging

DEV Community·Gabriel Anhaia·6 months ago
#e3RM6vQ3
Reading 0:00
15s threshold

Book: System Design Pocket Guide: Fundamentals

Also by me: Event-Driven Architecture Pocket Guide

My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools

Me: xgabriel.com | GitHub

A user taps "Pay $48.20" on flaky hotel Wi-Fi. The request leaves the phone, hits the API, the server charges the card, the response packet drops on the way back. The phone sees a timeout, the user taps again. Two charges land. Customer support spends 14 minutes refunding one. Multiply by every retry on every request a payments system handles in a day.

Idempotency is the load-bearing pattern that keeps that user from being double-charged, and the same pattern that keeps a write-heavy distributed system from creating duplicate orders, duplicate emails, or duplicate outbox jobs. The shape of the fix is well-understood.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.