Answer the question
In order to leave comments, you need to log in
What are the modern approaches to creating a News Feed?
Hello!
Actually, the problem is common, there is a project, there are various entities in the project, for example, "Person", "Institution", "Event". All these entities can generate news. Users can subscribe to some of these entities and then read their news in the feed.
This is where the most exciting begins: how and in what to store the tape? I found mostly two or three year old posts, where the most interesting option seemed to be the option of storing the tape for each user in Redis. But maybe some other solutions have appeared over the years? Maybe there is some special software for deploying a feed server?
Answer the question
In order to leave comments, you need to log in
Per-user tape storage is the most cost-effective and (very important) highly scalable way.
Roughly speaking, each activity in your project generates an event, and you already attach the formation of user feeds to these events in a way convenient for you. You just need to choose the right storage that meets your needs. And the choice will be determined by the following characteristics:
Everything seems to be quite simple. If there are indexes in the news table, the feed itself may not be stored. Keep only user subscriptions to entities. Like this:
Table news : id / autor_type / autor_id / ...
Where author_type is a link to the entity table, author_id is the entity id, respectively. Form a
feed for the user with a query like:
SELECT * FROM news WHERE (author_type = "$1" AND author_id = " $2") AND (author_type = "$3" AND author_id = "$4") ...
A topical question for me, I will soon write down an article about one of the PostgreSQL tape implementations with samples of no more than 1-2ms on sufficiently large amounts of data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question