Behind the Scenes of Amberflo’s Usage Based Metering and Billing System
Ofer Shterling
August 17, 2021

Behind the Scenes of Amberflo’s Usage Based Metering and Billing System

Introduction

In this article we will define and describe the concept of “Usage Based Metering System" (UBMS). We will describe the main types of systems it takes inspiration from, and show the difference of UBMS from one of these systems. Lastly, we will discuss the strengths of Amberflo’s unique approach and implementation in delivering a modern, scalable, and cost effective UBMS.


Usage Based Metering System (UBMS)

A Usage Based Metering System (UBMS) is a usage based telemetry metering system for SaaS which collects consumption, diagnostic, and status data of consumers of cloud-based services, and moves it into a central repository, for pricing, billing, audit, troubleshooting, analyzing, and forecasting.

A UBMS can be used for multiple purposes, from product and system operations to sales and CRM, and can serve both the SaaS  internal teams, and the SaaS consumers.

In fact, as we will see below, the UBMS model takes inspiration from both Automatic Meter Reading (AMR) systems (such as the ones used in electric or gas meter grids) and traditional monitoring systems. Combining these two domains allow the UBMS to serve as a very accurate customer oriented metering system for the cloud, which harnesses metering not just for operational usage, but also as a main tool for managing and operating a cloud business  and providing direct insight for the customers.






Similarity to AMR Systems

We all know what a utility meter is. We have a few of these meter readers at home that measure our gas, water, and electricity consumption. The technology for reading the meter and transmitting its value to the utility company is called Automatic Meter Reading (AMR). This is how we get billed for most of the basic household utilities.

The UBMS takes the concept of the traditional land based AMR systems and applies it to the cloud, so clients can be invoiced accurately based on their service consumption, rather than some sort of a fixed fee such as the amount of licenses they purchased in advance. The emphasis here is on doing it accurately. Accuracy is the core design principle of an effective UBMS, meaning that the UBMS guarantees that each recorded usage event:

  1. Can be related to a single client.
  2. Can be related to a timestamp which represents the real time when the event has happened (as opposed to the time the event was ingested by the system).
  3. Is recorded only once (no duplication).


As described in the image above the way UBMS guarantees its accuracy is by collecting additional metadata for each event processed by the service, which helps the UBMS deduplicate and index the data.

Back to the real world AMR analogy, when you turn on the air conditioner in your house, a meter records the usage and transfers it to a central database for billing, troubleshooting, and analyzing, conducted by your electricity company. This gives your electricity company a chance to monitor their grid, forecast future usage, and plan their resources accordingly.  

Much like that, when you use a service in the cloud, a UBMS records your exact service consumption, and sends it to a centralized database for billing, troubleshooting, and analyses.


Similarity To Monitoring Systems

As mentioned, UBMS is a combination of AMR and monitoring systems. Monitoring systems usually collect labeled numeric events related to the operation of your system, and then allow you to get a unified view of the operational health, respond to system-wide performance changes, or optimize the resource utilization. Some of these systems (CloudWatch for example) also allow you to aggregate data over long periods of time, set alerts, or search historical data.
Much like the most advanced monitoring systems, UBMS also allows you to view the health of your system, respond to changes and optimize the resource utilization. When data arrives into the UBMS’s central repository, it’s also being efficiently deduped, indexed, cached and stored, so you can query and aggregate it according to any type of metadata which is part of your meter definition. As any monitoring system you can also be notified about any event in near real-time.





UBMS vs Monitoring Systems

While UBMS can be as strong as any advanced monitoring system, a traditional monitoring system can't serve as a UBMS.

Unlike traditional monitoring systems, which usually use low granularity events, UBMS requires structured user-based events which allows it to process data by the customer or any other dimension which is part of the meter event.

Additionally, as UBMS also serves as a pipeline for pricing and billing, it needs to consist of an e2e pipeline that guarantees data accuracy, immutability, and idempotency.Traditional monitoring systems are not designed for and don’t operate to act as an  accurate usage metering tool. Therefore they don’t guarantee that the meters are recorded using the precise time of the usage-event which they came to describe, nor that the same event isn’t recorded more than once, and they don't persist the data in a way that it can be audited, or used for anything other than for monitoring the system operations.


Summary

As described, a UBMS is a usage based telemetry metering system for SaaS. It’s as strong as any other monitoring system, and yet by design it’s much more accurate and much more detailed than a traditional monitoring system. The presence of the detailed customer-related data allows the UBMS to be connected to external systems such as Billing or CRM systems. This, unlike monitoring systems, allows for external users (customers) to  interact with UBMS directly, see events, be notified, query the system, produce reports, and more.

UBMS in Amberflo

At Amberflo we came up with a UBMS system implementation which gives you even more advantages than what we described above.

Amberflo’s UBMS is an e2e solution, providing you with easy to integrate components for every stage of the metering life-cycle (data definition, meter ingestion, usage query, notifications and alerts, integration to pricing, forecasting, etc).

Amberflo’s UBMS is also very scalable (capable of consuming tens of millions of meter events per hour), low cost, and provides superior performance than other types of data store options such as time-stream, RDBMS or document db (we will share more info regarding that in future blog posts).

We have added a lot of emphasis on reliability. Resulting in:

  • Data realistically can’t be lost.
  • If one piece of the system fails the rest of the system can still be used.
  • The system knows how to fix itself immediately without human intervention, once a component is stored.
  • All of the user facing APIs can still operate even if any processed or cached data is missing.


Beta users can access more technical info about Amberflo services and how to start using Amberflo here. Sign up for the beta at www.amberflo.io.

Related Posts