Timeseries Indexing at Scale
artem.krylysov.com
artem.krylysov.com
I'm now thinking about employing the same structure for hisser[1]. Now it uses a regular index structure and quite complex parallel index scan on top of lmdb[2].
[1]: https://github.com/baverman/hisser [2]: https://github.com/baverman/hisser/blob/master/hisser/lmdb_s...
If you query avg(cpu.total{env=prod}) you get [1, 2]. If you query avg(cpu.total{env=prod,host=a}) you get intersection([1, 2], [1]) which is [1].
Right, how do you know at write-time that cpu.total{env=prod,host=a} is ID 1?
The user only supplies the metric name and tags.
I think this should be a principle now (copied from Jeff Atwood's famous quote):
Any infra application that can be written in Rust, will eventually be written in Rust
Secondly, there is a bunch of features from the SQL standard that is more or less complicated to get right with RocksDB under the hood, most importantly collations. This is because the bespoke table engines can create collation dependent indexes (ie how data is sorted on disk) whilst mapping an index to a Key-Value storage like RocksDB would require the ability to create rewrites of the strings to a binary encoding that remains sorted as per the collation (This is why MyRocks only supports binary, latin1_bin and utf8_bin collations).
See this page on limitations for MyRocks (the RocksDB MySQL engine), https://docs.percona.com/percona-server/5.7/myrocks/limitati...