...

>

Design of Newsfeed System

Design of Newsfeed System

Understand the high-level and detailed design of a newsfeed system.

Let’s discuss the high-level and detailed design of a newsfeed system based on the requirements discussed in the previous lesson.

High-level design

Primarily, the newsfeed system is responsible for the following two tasks.

  1. Feed generation: The newsfeed is generated by aggregating friends’ and followers’ posts (or feed items) based on some ranking mechanism.

  2. Feed publishing: When a feed is published, the relevant data is written into the cache and database. This data could be textual or any media content. A post containing the data from friends and followers is populated to a user’s newsfeed.

Let’s move to the high-level design of our system, consisting of the above two essential parts, shown in the following figure.

Let’s discuss the main components shown in the high-level design:

  1. User(s): Users can make a post with some content or request their newsfeed.

  2. Load balancer: It redirects traffic to one of the web servers.

  3. Web servers: The web servers encapsulate the back-end services and work as an intermediate layer between users and various services. Apart from enforcing authentication and rate-limiting, web servers are responsible for redirecting traffic to other back-end services.

  4. Notification service: It informs the newsfeed generation service whenever a new post is available from one’s friends or followers and sends out a push notification.

  5. Newsfeed generation service: This service generates newsfeeds from the posts of followers/friends of a user and keeps them in the newsfeed cache.

  6. Newsfeed publishing service: This service is responsible for publishing newsfeeds to a users’ timeline from the newsfeed cache. It also appends a thumbnail of the media content from the blob storage and its link to the newsfeed ...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy