Back to blog
Engineering

Billing at Scale: Why We Chose an Append-Only Ledger

A look under the hood of our billing system: immutable ledgers, snapshot balances and asynchronous settlement that keeps high concurrency safe.

David Li · Staff EngineerJune 12, 2026 · 8 min read

Balances are snapshots, not truth

Updating a balance column in place is simple until two requests race. Our ledger is append-only: every charge and refund is an immutable entry, and the balance is just a derived snapshot.

Audit becomes trivial because the history is the database — there is nothing to reconstruct.

Asynchronous settlement

Billing events are queued and settled by workers instead of being written synchronously on the request path. This keeps p99 latency stable even when traffic spikes tenfold.

What it buys us

Exactly-once accounting, no row locks on hot accounts, and the freedom to re-derive any balance from the ledger at any point in time.