Postgres
2 posts
Metering Is a Ledger, Not a Counter
Usage-based billing is a transactional problem. Reservations, compensations, and why a job that produces nothing has to refund what it held.
The Billing Bug You Can't Have
How emit's prepaid credit system makes overdrawing impossible under concurrency, using an append-only ledger and one carefully shaped SQL update.