Rating, Charging & Billing (RCB) has been an ongoing research initiative from ICCLab. As part of this, a proof of concept (PoC) for OpenStack has been developed and released under Apache Licence v2.0. The PoC is a standalone application which can collect the resource usage data from Ceilometer for a certain time period interval, define a pricing function per user, determine the price for the resource used per user and eventually generate a bill and display it via a PDF. This is demonstrated through a video.
Even though the architecture used in PoC was able to demonstrate all the basic functionality of RCB, it was not extensible and not suitable for being deployed in the distributed environment. It was also observed that the data produced at different stages for RCB process had the potential to create a platform upon which other applications using them, could be built. With these drawbacks, an attempt has been made to redesign the architecture from a modular & micro service perspective.
The new architecture has been split into multiple micro services consisting of User Data Records (UDR) Generator μ service, Rating & Charging μ service, Billing μ service, Message broker μ service and authentication service.
User Data Records Micro Service (UDR)
The UDR service interfaces with the Telemetry API to get the resource usage data from many meters which ceilometer provides access to. Using the statistics API end point, relevant data is grouped by instances, user & tenant and later transformed to be ultimately persisted in a usage time series database. Each of the meters associated with the Ceilometer is mapped to a time series in the database. The whole process of data collection and persistence is triggered by a scheduler for defined time intervals. UDR service also opens up an API for an external SaaS application to send usage data, which could eventually be persisted along with the resource usage data and considered for billing.
The aggregated data stored in the time series databases aides in performing further mathematical & analytical operations. This data is eventually passed on the the rating & charging micro service.
UDR Service has been released under Apache License v2 and the source code is available on GitHub at https://github.com/icclab/cyclops-udr
Rating & Charging Micro Service (RC)
The RC service consist of a rating engine which consolidates various data to determine the rate for a resource. As a major input to the rating engine, RC service interfaces with the server monitoring software to get the server load data. Also through the engine, different policies set for certain conditions can be set. As the rate determination is dependent on a number of external factors, this gives an opportunity to being in an element of dynamism into the process of determining the rate.
The rate value determined by the rating engine is used to combine with the usage data to determine the pricing value. This is persisted in the pricing time series database before being used by the billing micro service.
Billing Micro Service
Once the pricing value is determined for the collective resource used by a user, final stage of the RCB is carried out. Billing service consist of a Billing engine which consumes the pricing data and calculates the final bill value to be paid by the user. The engine is again rule based and is influenced by the discounts, plans, offers, etc.. for determining the expense. This data is persisted in a billing time series database before an invoice is generated. It also is integrated with the payment gateway to provide the last mile connectivity in terms of completing the RCB process.
Message broker service and authentication services are the subsidiary service. The message broker is used by the external SaaS application to send the usage data which is then collected by the UDR service asynchronously. The authentication service provides the inter service authentication which transporting the data between the micro services. The data stored in the time series database is visualized using various dashboards.
Currently, we are actively implementing the above architecture and are at an advanced stage of completion of the UDR μ Service. Outcomes of the implementation phase will be shared in the future blog posts.