Timeseries in Redis with Streams
01-Feb-2019 2362
Redis Streams represent an append-only timeseries of key-value pairs.Any number of clients can write to a Stream and each time they do they receive a unique ascending ID of the item that was inserted into the timeseries.Clients reading data can block while listening for new data coming in, can maintain a “bookmark” of the last message read for batch processing, or can be organized into more complex “consumer groups” for sharing workloads and acknowledging messages.Streams are a large topic, so this post will just look briefly at how to use them to model timeseries data in Redis. The new data structure makes this dramatically more simple than previous approaches like using List or Sorted Set types to model timeseries.For the code examples here we’ll use redis-rb:.
Timeseries in Redis with Streams #ruby #rubydeveloper #rubyonrails #Timeseries #Redis #Streams #redis https://rubyonrails.ba/link/timeseries-in-redis-with-streams