> For the complete documentation index, see [llms.txt](https://aaronice.gitbook.io/system-design/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aaronice.gitbook.io/system-design/system-design-problems/news-feed.md).

# Design News Feed

### **What are the different approaches for sending News Feed contents to the users?**

**1. Pull:** Clients can **pull** the News Feed contents from the server **on a regular basis** or **manually** **whenever** they **need** it.

**Cons:**

Possible problems with this approach are

a) New data might not be shown to the users until clients issue a pull request

b) Most of the time pull requests will result in an empty response if there is no new data.

**2. Push:** Servers can push new data to the users as soon as it is available.

To efficiently manage this, users have to maintain a [Long Poll](https://en.wikipedia.org/wiki/Push_technology#Long_polling) request with the server for receiving the updates.

**Cons:**

A possible problem with this approach is, a user who follows a lot of people or a celebrity user who has millions of followers; in this case, the server has to push updates quite frequently.

**3. Hybrid:** We can adopt a hybrid approach.

We can move all the users who have a high number of follows to a pull-based model and only push data to those users who have a few hundred (or thousand) follows.

Another approach could be that the server pushes updates to all the users not more than a certain frequency, letting users with a lot of follows/updates to regularly pull data.

## Reference

Gainlo.co: [Design News Feed System (Part 1)](http://blog.gainlo.co/index.php/2016/03/29/design-news-feed-system-part-1-system-design-interview-questions/) | [Design News Feed System (Part 2)](http://blog.gainlo.co/index.php/2016/04/05/design-news-feed-system-part-2/)
