Design a News Feed – senior-level system design challenge

Timeline reads and new posts grow to 30,000 requests a second at peak. Keep timelines fast, get every post into followers' feeds and search within 10 seconds, within budget.

Requirements

Goal

Hold p99 latency under 200ms, error rate under 0.5%, cost under $15,000/month through every stage of the test plan, then compare your design with a reference design.

The test plan

  1. Morning: 5,000 requests per second.
  2. Evening: 15,000 requests per second.
  3. Big match night: 30,000 requests per second.

Hint

Reads outnumber posts 19 to 1, so timelines must come from a cache, never assembled from the database per request. Save a post, publish it as an event, and let separate consumers update timelines and the search index at their own pace. Split the read and write paths so a burst of posts can't slow reading.

Solve it on the live simulator, free and in your browser.

Read the guide

More system design challenges