educative.io

Pre-generating the News Feed

We can have dedicated servers that are continuously generating users’ News Feeds and storing them in a ‘UserNewsFeed’ table. So whenever any user needs the latest photos for their News-Feed, we will simply query this table and return the results to the user.

Wouldn’t this cost a lot of space. We are pre-generating gradually, but what if the user is not an active users (only open once in a year) ?

@Stephen_Thajeb

That’s an excellent question. There are two layers to this question:

  1. Since we are generating a fixed size user’s NewsFeed, the overall size wouldn’t increase gradually with time, keeping the count of users constant.

  2. At the second layer, if we further wish to optimize our system, we can make the NewsFeed table filter dependent and generate feed only for users active for a specific period.