Orb stores usage as immutable events and calculates bills by querying event history at billing time. Traditional billing systems calculate charges as events arrive, mutating counters in real time. This architectural difference changes what’s possible.
When you send usage events to Orb, they’re stored immutably in a columnar OLAP store optimized for analytical queries. Events remain as raw data, preserving full flexibility.When it’s time to generate an invoice, Orb runs a deterministic query:
Fetch all events for this customer during this billing period
Apply the metric definitions (SQL queries over the events)
Apply the pricing configuration (rates, tiers, discounts)
Calculate the invoice total
Because this is a query, not a mutation, you can run it again with different parameters. Change the metric definition and recalculate. Change the pricing and recalculate. Backfill late events and recalculate. The original events never change.This makes billing reproducible. Every invoice can be regenerated exactly as it was calculated, or recalculated with new logic.
Query-based billing enables software development practices for pricing:Test before deploying. Run simulations against historical usage to see exact revenue impact. A SaaS company can model switching from seats to API-based pricing across their entire customer base, see the revenue delta for each customer, and validate the change before shipping. No risk, no guesswork.Version and rollback. Every pricing configuration is versioned. Revert a change by recalculating affected invoices with the previous pricing rules—no manual corrections, no corrupted data.Migrate atomically. Move thousands of customers to new pricing in a single operation. Orb’s diff engine ensures consistency: every customer switches at the exact right moment, no edge cases, no manual reconciliation.Handle late data safely. Events arrive three days after invoice close due to a batch job delay. Orb backfills the events, recalculates the affected invoices, issues credit notes automatically. The audit trail is complete. No manual patches, no lost revenue.Change metrics retroactively. Product realizes they should bill on compute hours, not API calls. Define the new metric, apply it to historical usage, and Orb calculates what customers would have been charged under the new model. Use this for pricing research, customer migrations, or contract amendments.Backdate enterprise contracts. Sales closes a deal on March 15th with pricing effective February 1st. Apply the new rates with a February 1st effective date. Orb voids the original February and March invoices, recalculates with the correct pricing, issues corrected invoices with credit notes. The entire amendment is atomic and auditable.
Traditional billing systems lock pricing logic at ingestion time. When an event arrives, it increments a counter. The counter determines the charge. If pricing changes, you need to re-ingest all historical data or accept that past and future billing use different logic.With Orb, pricing logic is applied at query time. The same events can be queried with different metrics, different pricing, different effective dates. This eliminates entire categories of coordination problems:
Metrics are queries, not pre-aggregated values, so you can define them after data arrives
Late data doesn’t corrupt calculations because there are no mutable counters to corrupt
Pricing changes don’t require pipeline changes because ingestion and billing are decoupled
Every charge traces to specific events and pricing rules because the query is reproducible
Billing becomes a calculation you can test, version, and change—not a side effect you hope gets locked in correctly.