TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Redis streams as a pure data structure

344 pointsby itamarhaberabout 6 years ago

9 comments

apeaceabout 6 years ago
I get that the tennis match use-case is meant to be trivial and an example, but I don&#x27;t buy it.<p>&gt; Before Streams we needed to create a sorted set scored by time: the sorted set element would be the ID of the match, living in a different key as a Hash value.<p>I think the sorted set would be a much better choice, because then you could still insert items in the past, like when that admin remembers there was a tennis match last week he never recorded. Same goes for modifying past values, or deleting values. These operations are trivial using a sorted set &amp; hash, not so using streams.<p>I&#x27;m excited for streams and I&#x27;m glad Antirez is taking time to blog and evangelize, but this article didn&#x27;t convince me there&#x27;s a compelling use-case for streams aside from the Kafka-like use-case.
评论 #19465222 未加载
drewdaabout 6 years ago
Just like it&#x27;s useful to have both SQLite and Postgres available for smaller and larger data projects (and Spatialite and PostGIS for smaller&#x2F;larger geo-data projects), it could be great to have Redis and Kafka for smaller and larger pipeline projects.<p>Does anyone have good patterns for joining across entries from two or more Redis streams? This is one of the most interesting aspects of Kafka&#x2F;Flink&#x2F;Spark&#x2F;Storm&#x2F;etc. Would be useful to be able to develop with streaming joins in Redis playgrounds.
skybrianabout 6 years ago
This seems pretty simple when events are logged as they happen with little or no latency and you can let the stream set the timestamp. I wonder, though, about the case where events may be buffered, perhaps due to an unreliable network? The time that the event occurred might be significantly earlier than the time it&#x27;s inserted, and furthermore events are arriving out of order. It seems like things get much more complicated?<p>Let&#x27;s say tennis games are recorded on a piece of paper and entered into the computer later. What is different?
评论 #19465198 未加载
评论 #19466365 未加载
nicoisabout 6 years ago
I threw together a few words here about how we are using Streams combined with Sorted Sets to &quot;upgrade&quot; legacy databases to streams of data. Not revolutionary, but it could be interesting to some people. I can write more, if there&#x27;s any demand: <a href="http:&#x2F;&#x2F;nicois.github.io&#x2F;posts&#x2F;databases-to-streams&#x2F;" rel="nofollow">http:&#x2F;&#x2F;nicois.github.io&#x2F;posts&#x2F;databases-to-streams&#x2F;</a>
_pmf_about 6 years ago
I wish we could standardize on using Redis as general interprocess transactional memory. I could drop 95% of our application code for our Embedded Linux platform by using stock Redis and stock SQLite, but of course there are political obstacles.
评论 #19463721 未加载
评论 #19464100 未加载
skrebbelabout 6 years ago
Did anyone yet use Redis streams to store actual logs? Like server logs, application logs, etc.<p>I understand that Elasticsearch is a common place to put logs, also because I assume that searching through logs is a common use case, but I wonder whether Redis has particular benefits for this use case. The data structure seems particularly tailored to it (but not so much to searching I guess).
评论 #19466304 未加载
评论 #19466119 未加载
_pgmfabout 6 years ago
Streams are kinda cool but they have a distinctly different feel than the other data-types in Redis. They&#x27;ve got this invisible statefulness. Last ids, consumer group state, etc. I&#x27;ve tried implementing a couple little things with streams, and it&#x27;s not necessary to use the consumer group stuff or whatever of course. I wonder why streams weren&#x27;t made using the modules API, though? They seem just weird&#x2F;different enough to warrant exclusion from the core data types, in my thinking. Anyways, just reading the title referring to streams as &quot;pure&quot; made me go wtf? Because there&#x27;s a lot of hidden state in there.
评论 #19465237 未加载
reggiebandabout 6 years ago
I wonder how this compares to streams in Kafka or Kinesis. One of the main advantages of redis is that I see it used in many cases as a replacement for memcache (just a key&#x2F;value store for bytes&#x2F;strings) so it already exists in many infrastructures.
评论 #19466236 未加载
erulabsabout 6 years ago
Streams are great! I&#x27;ve written a small library for Node which attempts to wrap some of the complexity (particularly for handling multiple connections for UNBLOCK calls, etc).<p>So far I haven&#x27;t used it outside of hobby projects for webGL games and such, but it&#x27;s worked brilliantly, and no Kafka required for hobby async-streaming infrastructure!<p>Hopefully it&#x27;s useful to someone out there! <a href="https:&#x2F;&#x2F;github.com&#x2F;erulabs&#x2F;redis-streams-aggregator" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;erulabs&#x2F;redis-streams-aggregator</a>