Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an RSS Feed Backend with Web Push Notifications

Check many third-party RSS feeds, find each new entry once, and send it as a browser push notification to every follower's browsers.

Problem statement

Design the backend for an RSS feed reader that sends web push notifications.

For this exercise, assume users sign in on a website, follow RSS feeds by URL, and allow notifications in their browsers. The backend checks each followed feed, finds entries it has not seen before, and sends a web push notification for each new entry to every browser of every follower.

Clicking a notification opens the entry's link. Users can also open a list of recent entries from the feeds they follow, newest first, covering the last 30 days.

For this exercise, also assume these rules. A feed URL is stored and checked once, no matter how many users follow it. A browser must not show the same entry as two separate notifications, even when work is retried or the feed edits the entry's title.

Entries that were already in a feed when its first follower added it do not cause notifications. A browser's push subscription can expire or be revoked at any time, and the backend must stop sending to it. Feeds are third-party servers: they can be slow, down, return broken XML, leave out entry IDs, or change them.

Push messages go through each browser vendor's push service, which accepts a message for later delivery, holds about 4 KB, and can reject or rate-limit the sender.

Hosting or writing feeds, full-text search, ranking, digests, email, mobile app notifications, and fetching full article pages are out of scope.

What to build

  1. A user can follow or unfollow an RSS feed by URL. The backend stores each normalized feed URL once and rejects a URL that does not return a valid feed.
  2. A user can register a browser for push notifications and remove it later. One user can have several browsers.
  3. The backend checks every followed feed on a schedule, records each new entry once, and shows it in each follower's recent-entries list.
  4. For each new entry, every active browser of every current follower receives one web push notification that opens the entry's link.

At scale

  • For this exercise, assume 1 million users with 1.5 browsers each on average, 500,000 distinct feeds, and 20 million follows. Most feeds have a few followers, but a popular feed can have 200,000.
  • For this exercise, assume each healthy feed is checked at least every 15 minutes, most checks find nothing new, and feeds add about 2 million new entries a day.
  • For this exercise, assume push messages for a new entry should be handed to the push service for all of its followers' browsers within 2 minutes at p95, even for the most popular feed, with about 10,000 push messages per second at peak.