Design a News Aggregator
Understanding the Problem
📰 What is a news aggregator? A news aggregator like Google News or Apple News collects articles from thousands of publishers, groups articles about the same story, and shows users a feed of headlines with a short summary and a link to the original. It doesn't write or host the articles. Its value is coverage (everything in one place), speed (breaking news appears within minutes) and organization (topics, top stories, a feed tuned to you).
A common variant is a feed aggregator across social media: a single feed that combines posts from a user's own accounts on several platforms. The pipeline is the same (ingest from many sources, normalize, store, serve a feed), but the sources are per-user and private instead of shared and public, which changes the cost model. We'll design the news version and cover the social version in the last deep dive. RSS ingestion is part of both, so it's in the main design.
Functional Requirements
Core Requirements
- Users should be able to view a feed of recent articles (headline, source, summary, thumbnail, link), either top stories or by category (World, Tech, Sports), and scroll through more.
- Users should be able to follow topics and sources and get a personalized feed.
- New articles from publishers should appear in the feed within a few minutes of publication.
Below the line (out of scope)
- Hosting full article text. We link to the publisher.
- Comments, sharing and notifications.
- Paywalls, ads and publisher payments.
Non-Functional Requirements
Core Requirements
- The system should serve 100M daily active users, each loading the feed about 10 times a day.
- Feeds should load in under 200ms.
- New articles should be visible within 5 minutes of publication, and faster for breaking news from major outlets.
- The system should be highly available and handle traffic spikes when big news breaks. Showing a slightly stale feed is far better than failing.
Below the line (out of scope)
- Strong consistency. Two users can see a new article a few seconds apart.
- Exactly-once ingestion. We'll dedup instead.
The math is lopsided, and that's the point:
- Reads: 100M × 10 = 1B feed loads a day, about 12k QPS on average and 50k+ QPS in a breaking-news spike.
- Sources: say 50,000 publishers with RSS or Atom feeds. Polling each one every 10 minutes is about 80 requests a second. Easy.
- Writes: those publishers produce on the order of 1 million articles a day, about 12 per second. At about 2 KB of metadata each, that's 2 GB a day, under a terabyte a year.
Reads outnumber writes by a factor of a thousand, and most readers want the same thing: the top stories in their region and a few popular categories. That means we should do the work once per article, not once per reader: precompute the shared feeds, cache them close to users, and build personal feeds out of those shared pieces.