Usage Stats Processor
Service that processes usage statistics for analytics and billing
Service
Overview
The Usage Stats Processor service handles high-volume processing of usage statistics. It’s optimized for batch processing with large batch sizes and batching windows to efficiently process usage data for analytics and billing purposes.
Architecture diagram
Performance Characteristics
- Batch Size: Up to 1000 messages per batch
- Batching Window: 60 seconds maximum
- Processing: Optimized for high-volume throughput
- Storage: Aggregates and stores usage data for analytics
Use Cases
- API Usage Tracking: Track API calls per tenant
- Feature Usage: Monitor feature usage across tenants
- Billing Calculations: Calculate usage-based billing
- Analytics: Generate usage reports and analytics
- Monitoring: Monitor system usage patterns
Processing Flow
How Usage Stats Processor Works
-
Receive Batch
Large batch of usage stat messages is received (up to 1000 messages)
-
Aggregate Data
Usage data is aggregated by tenant, feature, and time period
-
Store Statistics
Aggregated statistics are stored in the database
-
Update Billing
Usage data is used to update billing calculations
-
Generate Reports
Usage reports are generated for analytics
Integration
The Usage Stats Processor integrates with:
- Database: For storing aggregated usage statistics
- Billing Service: For usage-based billing calculations
- Analytics Service: For generating reports
Event-driven architecture documentation: Impulsell