Skip to content
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

How exactly is data structured and stored into keys? #12

Closed
athityakumar opened this issue Jun 18, 2019 · 1 comment
Closed

How exactly is data structured and stored into keys? #12

athityakumar opened this issue Jun 18, 2019 · 1 comment
Assignees

Comments

@athityakumar
Copy link

I've a feed with namespace kf and a redis instance instance $redis.

$redis.keys.select { |k| k.start_with? "kf" }.count
#=> 98

User.count
#=> 61462

Please let me know how I can access something like the result of SimpleFeed.knowledge_feed.activity(some_user_id).paginate(page: 1).map(&:value) using my $redis variable. I'm imagining something like $redis.get "appropriate key name" or something along those lines.

@kigster
Copy link
Owner

kigster commented Jul 3, 2019

Please check out the part of README that talks about how to expose Redis commands that are generated by SimpleFeed.

Not having seen your code, I don't know whether $redis is even pointing to the same Redis instance as your SimpleFeed.

But assuming you are talking to the correct Redis instance, I would say that you most likely did not call store for each and every User in your table, but perhaps you called it only for those users that have generated or received an event. Users that are not receiving any events via SimpleFeed would have NO feed created for them, i.e their feed would be nil.

Hope this helps.

Below is the image that is generated by running example file with REDIS_DEBUG variable set. Note that an "appropriate key name" is not as easy to guess since it's compacted using base62 I believe.

redis-debug

@kigster kigster self-assigned this Jul 3, 2019
@kigster kigster closed this as completed Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants