Timeseries in Redis with Streams

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 #redis https://rubyonrails.ba/single/timeseries-in-redis-with-streams

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles