Continue where you left off ×
Stripe, the case study
Everything · Open board
The whole shape at once: one card, one shopper, and every board below drawn as a single system.
Boards
Before you start. You need to know what a retry is: a computer that got no answer, so it asks again. That is the only background this note assumes. Everything else about moving money starts from zero.
The idea in 30 seconds
A request can be interrupted anywhere between “sent” and “answered”, so it needs to survive being repeated by accident: that’s what an idempotency key is for.
Money isn’t a number you overwrite. It’s pairs of matching lines you only ever add to: a debit and a credit that must sum to zero.
The fix for “how do I prove where the money is” is older than computers. Venice already didn’t trust a single balance number in 1494.
“Approved” is a hold, not a transfer. The real movement of money lags the receipt by about a day or two.
Because the pieces above can still drift apart in practice, the whole system checks itself against reality every night: reconciliation.
Stripe’s product is the ledger. Taking your card is the part in front of it.
Read the story
Lesson 102 of 115 in System Design
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson 2010: seven lines of code, and a promise that only covers the easy half The click that might be two charges 1494: the notebook that never lies The hold, and the two days it takes to become real money The nightly check that catches the one mistake in ten million 01 · The API & idempotency, in full 02 · Money movement, as a state machine 03 · The ledger, exactly 04 · The card networks and the two-day lag 05 · Manufacturing exactly-once 06 · Choosing boring technology at scale 07 · Everything after payments Retrieval (cold, no peeking) Terms it explains: idempotency key, ledger, debit, credit, reconciliation, API, unique constraint, shard, acquirer, card network, issuer, ISO 8583, tokenization, outbox.
Review System Design
Mark as read Saved in this browser, and to your account when you sign in.