Course contentsShow
← System Design
Lesson 1649 of 1,91940. Real-World System: Social Media FeedFree lesson

The Celebrity Problem in Fanout

Why fanout-on-write fails for users with millions of followers due to write amplification and resource constraints.

The Celebrity Problem in Fanout

What You'll Learn

You'll understand why fanout-on-write breaks down when users have millions of followers, and why writing to millions of feeds becomes technically and economically impossible.

The Core Issue

In fanout-on-write (the push model you've learned), every new post gets copied into each follower's pre-built feed. This works beautifully for regular users with hundreds or thousands of followers—but what happens when a celebrity with 100 million followers posts a single tweet?

The system must now perform 100 million write operations for one post. This is called write amplification, and it creates several catastrophic problems:

Write Amplification at Scale

  • Time: Writing to 100M feeds might take minutes or hours, not seconds
  • Resources: Database connections, queue workers, and write capacity get overwhelmed
  • Cost: Cloud providers charge per write operation—one celebrity post could cost hundreds of dollars
  • Locks: Attempting millions of concurrent writes can create database contention and deadlocks

Real Numbers

If a celebrity posts once and you have 1ms latency per feed write:

  • 100M writes × 1ms = 100,000 seconds = over 27 hours!

Even with parallelization, you'd need thousands of workers just to handle one post in reasonable time.

Why This Matters

The celebrity problem forces hybrid architectures: regular users get fanout-on-write (fast reads), but celebrities use fanout-on-read (their posts aren't pre-pushed). At read time, the system detects you follow celebrities and fetches their recent posts directly.

Key Takeaway: Fanout-on-write fails for high-follower accounts because write amplification makes it impossibly slow and expensive—one post can trigger millions of writes that exhaust system resources and delay delivery by hours.