Hi,
I need to implement memory-efficient time series, very similar to redis-timeseries project, with the following difference:
I would like my keys to contain only samples, and have these samples in the form of 64-bit integers. For example, a 2-hour string with 30 second step would be 240x8 bytes long. Because this is a plain array with well known structure, I would not need timestamps or separators.
The sample in a given step is the sum of partial samples measured by multiple processes. In other words, I have multiple instances of the same service, each aware of a slice of the total activity, and only by summing up the per-instance samples do I get the overall value.
For example, consider 10 application servers counting requests per second. Only by aggregating them does one get the total number of requests per second.
Ideally, I would need each instance to run a command that would do something like this (note the last argument):
INCR <key> <delta> <offset-in-key>
Perhaps a Lua alternative can be devised, but I wonder if the same performance concerns that pushed Salvatore to implement BITOP and BITCOUNT as full Redis commands are not applicable here?
An alternative would be to store samples per instance, but that would increase memory footprint 10 times.
How would you approach this?
Thanks a lot for your help.
Cheers,
Teleo