-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-feeds aggregation ? #4
Comments
Can you clarify what you mean by feed A, B and C? How do you plan to configure / define them, and then use them? |
Suppose I have a feed named user_navigation, saving all the pages the user have visited. I also have a feed name user_session, for the user sign_in/login/logout activities. These 2 feeds are separates, because the user_session feed is hidden to the normal user, and just shown for the admin. So normal user see feed user_navigation, and admin see both feeds. If a user can have multiple feeds, I want to be able to view a given user activities across all the feeds. |
I see, thanks for the explanation. You have two options:
I can add a filter option to the feed so that you can fetch a filtered set of items from the feed. |
I have explored both options already, but I think the best options would be a ZUNION directly on redis side. Option 1 is viable only when the number of feeds is small. When there is 3 feeds, it requires loading 3 feeds with 50 items each (total 150 items), sorted and filtered down to 50. A lot of overhead. Option 2 requires more overhead to extract items from a specific feed, as we must loop through each page to fill the minimum number of items for the pagination. A ZUNION, with the same API as multi-user would be perfect. |
While it's an interesting use-case, the gem was written with the idea that separate feeds are just that — separate. In fact, they might even be in completely different redis instances. Similar thing happens when sharding by So the use-case of merging two separate feeds is not something I am interested in supporting. However, what you are really asking is an effective way of filtering data within a single feed. That I can get behind. K |
I see, thanks |
Is there a way to get latest activities for a given user, from a list of predefined feeds ?
Suppose I have a feed A, B and C. I would like to retrieve all activities for the user just from the feed A and C.
The text was updated successfully, but these errors were encountered: