bonsaidb
bonsaidb copied to clipboard
Investigate: Time-Series Data
To offer better monitoring of BonsaiDb, we're going to want to offer a set of metrics. While we will want those metrics to be able to be reported externally, an average developer would enjoy being able to use BonsaiDb as their time-seried database for these metrics.
This ticket is a placeholder to investigate the capabilities of popular TSDBs and determine how best to approach storing that class of data within BonsaiDb.
I think there are two ways to store time-series data that make sense, and it depends on your use case. This ticket should be about providing a high-level interface using one or both of these interfaces:
- Use the Key-Value store with sorted sets (#145)
- Expose a reusable Collection that has a set of views to help query and filter data
The benefits of the key-value store is that it is incredibly lightweight. For high-traffic workloads that have a moderate number of metrics, the key-value approach will prevent a significant amount of bloat on disk from the data constantly being written.
On the other hand, the key-value store requires the sorted set to be in memory. This has a higher impact on memory usage. This might be able to be mitigated some by splitting the sets into "buckets" that get written individually.
At the time of writing this update I highly favor focusing on just the key-value store based implementation.