Modeling Money Movement: Ledgers, State Machines, and Exactly-Once Effects
How Stripe models money movement with immutable ledger entries and explicit state machines to guarantee correctness even when networks and services fail.
Engineering at scale
12 articles · 48 min of reading
How Stripe models money movement with immutable ledger entries and explicit state machines to guarantee correctness even when networks and services fail.
How Stripe treats documentation, client libraries, and API design as core infrastructure investments rather than a layer bolted on after the API ships.
Why Stripe built its own type checker, Sorbet, instead of rewriting its large Ruby codebase, and how gradual typing let adoption happen incrementally.
Why Stripe moved its compute platform onto Kubernetes, and the engineering work required to run a payments company's workloads on top of it safely.
How Stripe moves data between database schemas and systems while staying live, using a four-phase dual-write and backfill pattern instead of a maintenance window.
Why Stripe deliberately triggers failures and runs large-scale load tests against production-like systems before its highest-traffic days of the year.
How Stripe's Radar system scores payments for fraud risk in real time using machine learning trained across its network, without adding checkout friction.
How Stripe layers per-request rate limiting with system-wide load shedding to keep its payments API available when traffic spikes or dependencies slow down.
How Stripe's idempotency key design lets clients safely retry payment requests after a timeout without risking a duplicate charge.
Stripe's approach to API versioning uses per-account pinned versions and request/response transforms instead of forcing every integration onto the latest shape.
How Stripe delivers billions of webhook events to external endpoints reliably, with retries and an at-least-once contract instead of a guarantee of order.
Why Stripe engineers emit a single structured log line per request instead of many scattered ones, and how it changes debugging at scale.