Personal project / 01
Billing
A personal open-source billing platform experiment focused on understanding the internals of usage-based billing systems.
01 / Overview
Overview
Billing explores the lifecycle of usage-based billing, from accepting usage events to rating activity and generating deterministic invoices, with organization-scoped IAM and operational monitoring.
02 / Problem
Problem
Billing is a stateful domain where time, precision, retries, and lifecycle transitions interact. This project creates a practical environment for studying those concerns without presenting itself as a commercial product.
03 / Technical decisions
Technical decisions
- Go for explicit service boundaries and predictable concurrency
- PostgreSQL as the source of truth for transactional billing data
- Scheduled processing for billing-cycle work
- Observable workflows so delayed and failed operations can be investigated
04 / Challenges
Challenges
- Keeping rating and invoice generation deterministic
- Handling retries without duplicating financial effects
- Representing subscription and billing-cycle state transitions clearly
05 / What I learned
What I learned
- Financial correctness depends on explicit domain invariants
- Idempotency belongs in the design, not only at API boundaries
- A billing system needs an audit-friendly model of how each amount was produced