Reputation: 1235
I checked out Redis pub/sub functionality and at first glance it looks perfect for something like forming a twitter feed. However I tried to google for Redis pub/sub and newsfeed and I can barely find any example or use case about this. If Redis is actually not good for this, what are the disadvantages?
Upvotes: 1
Views: 1421
Reputation: 99
First of all, Redis pub/sub is not a data storage, but just a data flow channel.
For example(Chronologically sequenced)
news:feed
news:feed
news:feed
This scenario works fine. But the following doesn't:
news:feed
news:feed
news:feed
In this case, user A will never receive the message published by User B, before he (A) joined.
If you want to implement newsfeed using pub/sub, you have to create several channels (at least as many as users). Here is an implementation of a simple Twitter clone: http://redis.io/topics/twitter-clone
Upvotes: 2