1đź‘Ť
What you are actually doing requires
- aggregation logic (which you can write in python since your main framework is django)
- a task queue running in the background which executes these aggregation logic
- denormalized and duplicated data in your redis database, repeating data which are relational in your main database, such as your postgresql database
You can breakdown your activity feed into its components which are aggregated together on redis but are related to each other on your relational database.
Bob
and Kyle
and poems
and Beautiful piece
are objects, respectively user object, user object, a poem object and a comment object which are stored in your relational database.
Your activity types are “following”, “liked”, “commented”.
You can then write your python logic to aggregate them into a single feed item which is stored in your redis database and each of these feed item is composed of objects and activity types (and a time stamp in which that activity happens).
That’s the primary design consideration to get started.
Here’s a good example – https://github.com/SupermanScott/redis-activity-example
1đź‘Ť
Stream-Framework is an open-source library made to build feeds and supports both Redis and Cassandra as storage backends.
You can check it out on github
Disclaimer: I am one of the authors of Stream-Framework
- [Answered ]-How to autofill fields in django
- [Answered ]-How to set 2 rows to become header in a dataframe with originally has a header?
- [Answered ]-Creating Generic Views in Django
- [Answered ]-Retrieving OneToOne related QuerySet in Django
- [Answered ]-Resource has no available deserialization method