0

I would like to add different types to my Timeseries database. For example, I may want to store a byte string or hashmodel but it seems like it can't and instead I get redis.exceptions.ResponseError: TSDB: invalid value

Is there not a way to add other types other than values in RedisTimeseries?

LeanMan
  • 474
  • 1
  • 4
  • 18

1 Answers1

1

You cannot. Each sample must be composed of a 64-bit integer timestamp (milliseconds since the UNIX epoch) and a 64-bit floating-point value. That's it.

Lior Kogan
  • 19,919
  • 6
  • 53
  • 85
  • Is there a way to have much more complex data be stored in a timeseries fashion? I want to make use of the key timestamp, RANGE start end query and FILTER features of RedisTimeSeries and at the same time not be limited to just a numeric value. I would assume that this isn't the first time this problem has been encountered and its either that there is a pattern with RedisTimeseries that might address this, or it addresses a completely different use case and that there is a another pattern for what I am trying to do. I assume what I aim to do can be done with Redis however. – LeanMan Aug 22 '22 at 12:28
  • 1
    No. If you don't need aggregations maybe RedisJSON would be a better fit for your use case. – Lior Kogan Aug 22 '22 at 12:33
  • Does that still do queries with a given start/end timestamp and allow for filter by labels (or object attributes)? I am very much dealing with Timeseries data. – LeanMan Aug 22 '22 at 18:02
  • It seems like the way I will have to implement this is to use a sorted set with a timestamp as the score and the value a list of keys to a JSON or Hash object in the database. I hope that makes sense. – LeanMan Aug 23 '22 at 04:03
  • Hello, @LeanMan, can you please expand a little on your last comment? Thanks a lot – Dragos Petcu Jun 22 '23 at 06:53