RedisTimeSeries icon indicating copy to clipboard operation
RedisTimeSeries copied to clipboard

Added support for binary data

Open tbultel opened this issue 3 years ago • 8 comments

The RedisTimeSeries API is cool, but makes a strong presumption on the fact that the timestamped data is of type double, that allows simple maths on aggregation functions. All the rest of the API (range queries, labelling, downsampling, rules ... ) is of interest for non-scalar data. This commit adds support for binary data. In can coexist with scalar data, so that the API remains 100% compatible. Just like scalar time series, binary time series can be created with 'TS.CREATE' or 'TS.ADD', just by adding the 'BLOB' keyword in the command.

Aggregation is supported but obviously, performing maths on blob is nonsense, so that only aggregation types of 'count', 'first' and 'last' are allowed.

Persistence on disk is also supported.

The testsuite has been completed with the test of the new features, and passes 100%

Signed-off-by: Thierry Bultel [email protected]

tbultel avatar Apr 19 '21 15:04 tbultel

Hi despite of all my attempts, I cannot reproduce the valgrind failure on my side, even when I am using the debian-buster container.

This is the way I launch the test:

make test TEST=test_ts_blob:test_blob VALGRIND=1

Am I missing something ? Thanks !

tbultel avatar Apr 27 '21 08:04 tbultel

Hi, all tests completed with OK status. Is this Ok for that PR to be merged ? Thanks !

tbultel avatar Apr 30 '21 19:04 tbultel

Hi @tbultel, Sorry for the long wait. We are not sure yet if and how we see this feature in RedisTimeSeries. Can you explain why this is more useful for you than using redis streams?

danni-m avatar May 02 '21 13:05 danni-m

Hi @danni-m, There are several reasons why it is of interest to have the feature in RedisTimeSeries:

  • leverage the Duplicate policies
  • from user applications, have a single an unified API to store/retrieve data
  • same timestamping / labelling mechanism
  • leverage some aggregation

To illustrate with a real world use case of us, let's take the example of collecting data from a big passenger boat, with many and various sensors. Most of the time, 'float' of 'integer' data is enough. But there are some other special case, where upon an alarm, a short sample of sound, for instance, or a screen shot, or a picture, could be acquired. Another identified case is when sensors with some close IP report opaque data.

Hope this helps ! Thierry

tbultel avatar May 03 '21 14:05 tbultel

Hi, could anyone consider my PR again ? Thanks !

tbultel avatar May 25 '21 12:05 tbultel

Sorry, closed it by mistake. @Danni, would you mind having a look on it ? It is now months I rebase it, about once a week. Thanks !

tbultel avatar Jun 22 '21 14:06 tbultel

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 22 '22 14:09 CLAassistant

@tbultel This is a really cool feature; if such functionality exists, the number of keys I need could be reduced by several orders of magnitude.

kamikyo avatar Feb 22 '24 03:02 kamikyo