Checked in under a millisecond
Feature access is cached for the frequency it is actually asked at, which is every request.
Usage-based billing for SaaS: meter events in batches, check entitlements, price them with graduated, volume, flat or hybrid tiers, and generate invoices with taxes and discounts. Money is integer-only throughout. Entitlement checks are cached and sub-millisecond because they end up on the hot path of every request.
Cached feature access lookups, because a permission check that sits on every request cannot afford a round trip.
Batched ingest with non-blocking calls and an automatic flush, so metering does not become the bottleneck it measures.
Multi-currency handling with proper decimals and no floating-point error anywhere in the arithmetic.
Billing, metering and entitlements for a product that charges by what people actually use.
Feature access is cached for the frequency it is actually asked at, which is every request.
Usage ingest is batched and non-blocking with an automatic flush, so the call that records usage does not slow down the thing being measured.
Graduated tiers, volume pricing, per-seat, flat rate and hybrids, defined in Go, so a price change turns up in review.
Upgrades, downgrades and cancellations with proration and period management computed from the billing period.
Invoices are generated from the metered usage and handed to a payment provider for collection.
Currency is held as integers with multi-currency support and proper decimal handling, so a rounding error cannot accumulate into a real one.
Plans, terms and changes over time.
Usage recorded as events, aggregated on read.
What a customer may do, derived from their plan.
Generated from the record, not from a running total.
Ledger is a usage-based billing engine for Go: meter events, check entitlements, compute invoices, manage plans and subscriptions, and integrate a payment provider.
Money is integer-only. There is no float anywhere in the codebase. Every rounding decision is explicit and happens at a named place, because the alternative is a reconciliation conversation with a finance team about half a cent.
Identifiers are TypeIDs: globally unique, K-sortable, and prefixed, so an id in a support ticket tells you what kind of thing it refers to without a lookup.
Storage is pluggable across PostgreSQL, SQLite, Redis and memory, and Chronicle integration gives the audit trail that billing disputes eventually require.
Shipping something on Ledger? Nobody is listed here yet. Tell me what you built and you will be the first.
Get listed →