Requirements of a Newsfeed System’s Design
Get introduced to the requirements and estimation to design a newsfeed system.
Requirements
To limit the scope of the problem, we’ll focus on the following functional and non-functional requirements:
Functional requirements
- Newsfeed generation: The system will generate newsfeeds based on pages, groups, and followers that a user follows. A user may have many friends and followers. Therefore, the system should be capable of generating feeds from all friends and followers. The challenge here is that there is potentially a huge amount of content. Our system needs to decide which content to pick for the user and rank it further to decide which to show first.
- Newsfeed contents: The newsfeed may contain text, images, and videos.
- Newsfeed display: The system should affix new incoming posts to the newsfeed for all active users based on some ranking mechanism. Once ranked, we show content to a user with higher-ranked first.
Non-functional requirements
-
Scalability: Our proposed system should be highly scalable to support the ever-increasing number of users on any platform, such as Twitter, Facebook, and Instagram.
-
Fault tolerance: As the system should be handling a large amount of data; therefore, partition tolerance (system availability in the events of network failure between the system’s components) is necessary.
-
Availability: The service must be highly available to keep the users engaged with the platform. The system can compromise strong consistency for availability and fault tolerance, according to the
.PACELC theorem The PACELC theorem is an extension of the CAP theorem that states, in the event of network Partition, one should choose between Availability or Consistency; else, choose between Latency and Consistency. -
Low latency: The system should provide newsfeeds in real-time. Hence, the maximum latency should not be greater than 2 seconds.
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.