Overview
Zevium is an API marketplace where developers and agents pay per call. I built its backend systems.
Payments and credits
I migrated the payment flow from Autumn to Polar and integrated secure billing. On top of it, I designed a credit-based usage system: users buy credits and spend them as they call marketplace APIs.
The write problem
Usage produces far more writes than reads, because every call is a transaction to record.
- 01API call
- 02Redis (real time)
- 03Worker cron
- 04SQLite (batched)
Transactions are recorded in Redis as they happen. A Cloudflare Worker cron job then persists them to SQLite in batches, which keeps the serverless setup cost-efficient as usage grows.
