Core concept: billing as a query
Billing is treated as a pure function. Usage events are stored immutably. When generating an invoice, Orb queries:“Given this customer, this billing period, and this subscription and pricing configuration, what should the invoice look like?”Invoices are derived from:
- Raw usage events: All usage data is stored immutably and forms the foundation for invoice calculation.
- Immutable metric definitions: Metrics themselves are immutable. If usage events need to be amended, Orb applies amendments as a read-path overlay, layering corrections or changes on top of the original events to calculate the correct set of events to honor.
- Versioned pricing objects: Pricing changes are tracked over time, supporting accurate billing for any period.
- Versioned subscription timelines: Subscription changes are recorded as timelines, allowing for precise reconstruction of billing states.
- Deterministic results: The same inputs always yield the same output, ensuring consistency and predictability.
- Full auditability: Every line item is traceable to its underlying usage and configuration, supporting robust audits.
- Safe backfilling: Delayed data or configuration fixes can be re-run safely without risk of corruption.
- Simulation capability: Pricing changes or plan migrations can be tested before being applied, enabling safe experimentation.
- Scalability: Heavy computation is performed offline, so production traffic is not impacted by expensive aggregations.
Just-in-time invalidation and invoice computation
Orb does not run full-period queries only at invoicing time. Instead, a dependency graph and invalidation system track how each invoice fragment depends on usage, pricing, and configuration. When relevant data changes—such as a late-arriving usage event, plan migration, or pricing update—only the affected invoice fragments are invalidated. When an invoice is generated, Orb computes only the invoices and fragments that are out of date, based on the latest state. This approach provides:- Efficiency: Only the minimal set of invoices are recomputed, even as data changes across millions of subscriptions.
- Correctness: Every invoice reflects the latest, correct state, regardless of the number of changes or corrections.
- Safety: The system is idempotent and auditable, with every change traceable and reversible.
Why this matters — real‑world impact
Most billing platforms mutate counters when events are ingested. This makes backfilling difficult and corrections risky. Orb’s architecture avoids these problems by not relying on pre-aggregated counters. If pricing changes, usage is delayed, or a subscription is misconfigured, Orb allows the inputs to be fixed and billing to be re-run. This is not possible in stream-mutation systems without manual intervention. This architecture enables:- Rapid revenue reconciliation: Finance teams can reconcile revenue quickly, even after changes or corrections.
- Safe backfilling of data: Engineers can backfill data without risk of corrupting billing records.
- Iterative pricing changes: Product managers can iterate on pricing safely and efficiently.
Real‑time alerting performance & scale
- SQL fidelity end‑to‑end: Every alert expression starts as a SQL query over full event history, and Orb translates it into a streaming plan whenever possible.
- Fast alerting for streaming metrics: For any metric that can be evaluated incrementally, Orb maintains strict SLAs for the time from event to alert.
- Flexible by design: If a metric cannot be computed in-stream, Orb schedules periodic evaluation automatically.
- Optional hosted rollups: For extreme volumes, Orb can materialize rollups while raw events are still sent.
- Field‑tested reliability: The system is used by companies processing upwards of a million events per second.
Raw data, high‑throughput analytics
All usage events are stored in a columnar OLAP store. This provides:- High throughput: Production clusters sustain much higher throughput than typical OLAP stores.
- Flexible analytics: Query raw events via Orb’s SQL‑powered API to break down usage by any property.
- Retroactive metrics: Define a new metric and calculate it back to day zero without re‑ingesting data.
- Simulation: The same raw dataset powers Orb Simulations, replaying historical events through hypothetical pricing.