Metering — Counting Billions of Events Without Losing One
Usage-based pricing has a humble prerequisite: you must count correctly. Not approximately — correctly, at whatever volume success brings, across retries, duplicates, late arrivals, and clock skew, because every counted unit is money and every miscounted one is a dispute. Metering is stream processing where the aggregation result appears on an invoice, and that destination changes every engineering trade-off.
Metering is stream processing with invoice-grade obligations: deterministic source-minted idempotency keys, dedup at the door, event-time aggregation into exactly one billing period with a grace window, compensating events instead of mutation — and two meters: streaming approximate for the product, batch exact for the invoice.