Usage billing is a data-engineering problem
Why metering breaks at scale, and how checksummed event streams keep 41M events honest.
Most billing systems treat usage as a number you are given. At scale it is not a number, it is a stream, and streams lose events, duplicate them, and arrive late.
The three failures
- Late arrival: an event for the 30th lands on the 2nd, after you billed
- Duplication: a retry writes the same event twice and the customer is billed twice
- Silent loss: an event never lands and you under-bill without ever knowing
An invoice you cannot reproduce from the event stream is a guess with a due date on it.
Checksums before invoices
The fix is to make the invoice line a claim about the stream that can be checked. Each metered line carries the window it covers and a checksum of the events inside it. Before the bill goes out, the line is recomputed from the stream; if the checksum disagrees, the run halts rather than sending.
Across 41 million events a month, that is the difference between zero variance and a monthly credit-note habit that quietly trains your customers to audit you.
Close the month on the first.
Free up to $1M ARR. Ninety seconds to your first invoice.