The B2B Podcast Index
The CTO Podcast with Fexingo

How Stripe Uses Idempotency Keys to Prevent Double Charges

The CTO Podcast with Fexingo · 2026-06-03 · 10 min

Episode notes

Stripe processes billions of dollars in payments every year. One double charge could destroy trust. In this episode, Lucas and Luna break down how Stripe uses idempotency keys - a simple but brilliant engineering pattern - to guarantee that even if a network request is retried dozens of times, the customer is charged exactly once. They walk through a real-world example: a customer hitting 'Place Order' twice during a card decline, the first attempt succeeds, and the second attempt should not create a duplicate charge. Lucas explains the idempotency key lifecycle: generation, storage in Redis, TTL, and response replay. He contrasts Stripe's approach with a naive dedup table and explains why idempotency is a design philosophy that ripples through error handling, database transactions, and API contracts. Luna pushes on edge cases: what if Redis goes down? What about race conditions between write and read? Lucas covers the safety nets - conditional writes, single-node Redis with replication, and the trade-off between performance and consistency. The episode closes with practical advice for any engineer building payment or booking systems: start with idempotency from day one.

More from The CTO Podcast with Fexingo

All episodes →
Explore the best B2B Engineering & DevTools podcasts →
All The CTO Podcast with Fexingo episodes →