Design a Publisher News Feed
Design a link-only news feed that lets publishers post articles and lets users browse recent articles from the publishers they currently follow.
Problem statement
For this exercise, assume publishers submit article metadata containing a title and an HTTPS link, and users browse a reverse-chronological feed of articles from publishers they currently follow before clicking through to the external site.
The service stores article metadata and feed state, not the external article body. A user can follow or unfollow a publisher, a publisher retry must not create duplicate articles, and feed pagination must remain stable while new articles arrive.
Design for highly skewed publishers, including some with millions of followers, without making every publish operation unbounded. Recommendation ranking, personalization, search, comments, likes, advertising, article-body ingestion, and hosting the linked content are outside the initial scope.
What to build
- For this exercise, an authorized publisher can idempotently publish immutable link-article metadata and receive a stable article ID.
- For this exercise, a user can follow or unfollow a publisher, and subsequent feed reads use the user's current follow set.
- For this exercise, a user can page through a deduplicated reverse-chronological feed containing only articles from publishers the user currently follows.
- For this exercise, a feed item returns the publisher, title, publication time, and validated external HTTPS URL so the client can open the article outside the feed service.
At scale
- Source fact: publishers can publish articles, users can view articles from followed publishers, and an article may be a link that the user clicks to view its content.
- Practice assumption: support 20 million users, 200,000 publishers, and individual publishers with up to 10 million followers.
- Practice assumption: support peaks of 2,000 article publications per second and 200,000 feed reads per second, with feed reads completing within 300 milliseconds at p95.
- Practice assumption: a published article becomes eligible for follower feeds within 30 seconds at p95; article metadata is retained for one year, events may be delivered at least once, and derived feed entries must be rebuildable from durable article and follow data.