How ACID Protects a Stripe Payment

Concept. One payment updates several records that must agree. Atomicity commits those records together. Consistency keeps the ledger balanced. Isolation prevents concurrent payments from losing a balance update. Durability preserves a confirmed payment after a crash.

Intuition. Mickey clicks "Pay $9.99." The payment system authorizes the card, then records the payment, updates the ledger and merchant balance, and queues a webhook. ACID protects the internal database writes from partial failure, concurrent updates, and crashes.

Case Study 4.1 Reading Time: 7 mins


What one payment touches

Stripe processes roughly $1T of payments a year. Every "Pay" click triggers several internal writes:

After a Pay $9.99 click authorizes the card, one database transaction records the payment, writes two balancing ledger rows, updates the merchant balance, and queues a webhook. All four internal writes commit together or none do.

Figure 1. After card authorization, the database records the payment, writes two balancing ledger rows, updates the merchant balance, and queues a webhook. One transaction commits those four internal writes together.

If one internal write fails, the database rolls them all back. Isolation prevents an unsafe interleaving from losing a balance update. Durability preserves the committed records after the server returns 200 OK. Together, the four ACID properties protect the payment's internal state.


What each property prevents

A two-by-two grid of four payment failures and the ACID property that prevents each: an internal payment record commits but its webhook does not, a ledger's rows stop summing to zero, concurrent payments lose a balance update, or a confirmed payment vanishes after a crash.

Figure 2. Four failures map to four guarantees: atomicity prevents partial internal writes, consistency keeps the ledger balanced, isolation prevents concurrent payments from losing a balance update, and durability preserves a confirmed payment after a crash.

ACID gives the payment system a precise contract for failures, concurrency, and recovery.


The external card authorization cannot join the database transaction. The payment system coordinates that boundary with payment state, idempotency keys, retries, and refunds.

Takeaway: ACID protects the payment system's internal records, while idempotency and explicit payment state coordinate retries across the external card network.