Skip to content
System Designer

Work later · 3 minutes

One post, millions of feeds

A post by a celebrity must reach millions of feeds; do it in the background.

Open this lesson
A post by a celebrity must reach millions of feeds; do it in the background.

Write once, read once, or both

When someone posts, followers must see it. Fan-out on write copies the post into every follower's feed now, so reading is fast. Fan-out on read leaves it alone and builds the feed when someone opens the app. Celebrities with 20 million followers make the first approach very heavy.

A mix

Compare copying a post when it is written with merging it when a feed is opened. A mix can spare large authors the biggest write bursts.

Try the idea

A celebrity post makes 25 times the writes. Absorb it with a queue and workers.

Key numbers

Average account
≈ 200 followers. approx.
Celebrity account
≈ 20 million followers. approx.
One post by a celebrity
≈ 20 million copies. if written to every feed

Check your reasoning

Think through these questions before opening the lesson. In the game you can test the idea and compare your reasoning.

  • Fan-out on write makes:
  • Why queue the copying?
  • How do big feeds treat celebrities?

The key point

Do heavy fan-out in the background, and treat huge accounts differently.

Practise this idea

Continue through the lesson tracks