BYOC is currently in early access. Contact us to learn more or join the program.
Event ingestion
Your application reports usage events to the BYOC metering endpoint using the same Stigg SDK or API calls you use today — only the endpoint URL changes. The metering service accepts:- Single events
- Batches of up to 1,000 events per request
- Parallel reporting from multiple distributed services without coordination
Throughput
The BYOC metering service is designed to sustain up to 1,000,000 usage events per second. This is achieved through:- Stateless, horizontally scalable ingestion layer
- Kafka as the durable, high-throughput event buffer between ingestion and aggregation
- Flink for real-time stream processing and per-customer usage aggregation
- ClickHouse as the columnar store for fast usage queries and durable event retention
Aggregation and current usage
Ingested events are aggregated in real time to maintain a running current usage total per feature per customer. This aggregated value is what the SDK reads when checking entitlements or current usage — not the raw event stream. The aggregation pipeline:- Events land in Kafka (durable buffer in your cluster)
- Flink consumes events in micro-batches and updates per-customer usage counters in ClickHouse
- Aggregated usage counters are cached in a low-latency store for fast reads
- The entitlement check path reads from this store — typical read latency is sub-millisecond
Idempotency
The BYOC metering service inherits Stigg’s built-in idempotency guarantees. Duplicate events (identified by event ID) are discarded at the buffer layer, before aggregation. Reporting the same event twice does not double-count usage.Billing rollups
Aggregated usage totals are periodically rolled up and sent to Stigg Cloud. Raw events are not transmitted — only the counters required to compute billing. Rollup frequency and format are configured during provisioning.Durable event storage
All raw usage events are stored in their original format in ClickHouse within your cloud environment. This allows you to:- Audit raw event data
- Reprocess events if aggregation logic changes
- Rebuild usage totals from scratch if needed
