'Design usage based billing model for IoT platform

I have a IoT platform that sends each user's usage to Kafka topic (at least once per minute).

user's usage:

[{"userId":"1", "usagetype":"type1", "count":5},{...}]
  1. what is the best database to store user's usage? (I have considered Cassandra so far )
  2. How to store data in database so that data is optimized when calculating bills?
  3. how can calculate bills for lots of users (periodic or based on stream) and how store them?


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source