tschellenbach / Stream-Framework

Stream Framework is a Python library, which allows you to build news feed, activity streams and notification systems using Cassandra and/or Redis. The authors of Stream-Framework also provide a cloud service for feed technology:
https://getstream.io/
Other
4.73k stars 541 forks source link

How or where the follow relationship is stored ? #222

Open The-Neo-Noir opened 6 years ago

The-Neo-Noir commented 6 years ago

I am trying to understand this framework, but could not figure out how the follow relation is established and where that information is stored ( redis, or Cassandra)

cosmologist10 commented 5 years ago

I am also stucked at same place and I am also not getting how serialized activities is stored in redis storage level. If you got it's workflow, can you please explain

tbarbugli commented 5 years ago

@The-Neo-Noir there is no follow storage included in the framework. The framework include APIs to create follows (and remove) between feeds (eg. let timeline X follow user Y) but where you store that is up to you. A common approach is to have a follow table to keep track of follow relationships.

If you are familiar with Django:

@cosmologist10 the activity storage on Redis is pretty simple, they are stored in a K/V way

https://github.com/tschellenbach/Stream-Framework/blob/master/stream_framework/storage/redis/activity_storage.py

Timelines don't include the full activity but only references

https://github.com/tschellenbach/Stream-Framework/blob/master/stream_framework/storage/redis/timeline_storage.py

cosmologist10 commented 5 years ago

Thanks for response. I have solved few dependencies issues, while running test cases. Let me know if I can contribute.

tbarbugli commented 5 years ago

@cosmologist10 that's great to hear! Best way is to create a PR with your changes

cosmologist10 commented 5 years ago

@tbarbugli cool, I will create a PR by E.O.D and I have also solved docker issue of pinterest example. But even after solving all these issues, I am still not able to integrate this framework with my application. So, I am now trying to build feed modules from scratch.

goupgoupgoup1111 commented 5 years ago

I have a question that when using redis to save notification feed (count, seen/unseen, read/unread) on ram, what happen if redis was restarted and how to init these value again?

vlafranca commented 5 years ago

I have a question that when using redis to save notification feed (count, seen/unseen, read/unread) on ram, what happen if redis was restarted and how to init these value again?

Redis is persistent, so it keeps data even if you restart it. StreamFramework is only a processing moddleware, all the stuff you put into streamframework should be stored into a real database for legacy storage purpose. This way if you face a data loss you're able to replay it from your database. Django uses an sqlite db by default.

goupgoupgoup1111 commented 5 years ago

Hi guys, How can i get FULL data of actor and object of an activity? Because i can only get activity id and object id not FULL data. This is my code

get_feed_notification = manager.get_feeds("scott")['notification']
get_feed_notification_activities = get_feed_notification[:25]
for item in get_feed_notification_activities:
    group = item.group,
    is_read = item.is_read,
    first_activity = item.activities[0],
    actor_of_activity = ?,
    object_of_activity = ?