September 29, 2021
AWS best practices mention the metering aspect in their saas boost user guide https://github.com/awslabs/aws-saas-boost/blob/main/docs/user-guide.md#billing-and-metering
In 2019 at an AWS reinvent session I noticed a very interesting diagram:
Many great companies rise to the occasion and tackle the cloud-native deployment automation, monitoring, identity, and metrics but somehow the metering and billing aspect was neglected. The system of record built on top of a metering service is fundamentally different than one built on monitoring data.
In a microservices architecture, you can find a metering service in many companies that is responsible for this functionality. From our experience, it’s not easy to build such a service. Let’s go over a few of the challenges of building a scalable and reliable usage metering service:
1. Count once and only once: Make sure your customers are not overcharged (or undercharged)
2. Performance with large data scan ranges
If you try to sum the total number of events, across a large timeframe, it can quickly reach into tens of millions of events for a single query. If you try to do this on a time-series database, your costs are going to be prohibitively high, and in standard data warehouses, the latency is going to be very high. For example, looking at aggregated data over the last 12 months.
Using elasticsearch (or any other logs-based system) for example cannot run aggregation on the last 6 months per customer in a performant latency.
3. Alerts and notifications
4. Out of the box dashboards
5. Developer artifacts
6. Pricing plans models- Decouple engineering from product pricing decision
Using Amberflo.io Metering-as-a-Service you will get a robust, reliable, cost-effective fully managed metering service. https://www.amberflo.io/
When products adopt consumption-based pricing models, they encounter what may seem simple task of metering and tracking usage across their customers. It turns out, it is a heavy lift.