← Lessons

quiz vs the machine

Platinum1850

System Design

The Fan Out For Broadcast

Expanding one broadcast into millions of personalized sends without overload.

6 min read · advanced · beat Platinum to climb

One message many recipients

A broadcast targets a large audience: all users in a region, or every follower of an account. The service must fan out one request into millions of individual sends, each respecting preferences and tokens.

Fan out strategy

  • A planner resolves the audience into a stream of user ids, often paged from a database.
  • Work is split into batches placed on queues so many workers process in parallel.
  • Each user still passes preferences, rate limits, and dedup.

Avoiding a thundering herd

Sending all at once can overwhelm gateways and your own infrastructure. Throttling and smearing the send over a window protect providers and smooth load.

Failure isolation

Because one broadcast is many independent sends, a failure for one user must not stop the rest. Progress is checkpointed so a restart resumes rather than restarts the whole job.

Key idea

Broadcast fan out expands one request into millions of throttled per user sends with checkpointing so failures do not block the rest.

Check yourself

Answer to earn rating on the learn ladder.

1. Why throttle or smear a broadcast over time?

2. How does the planner produce work?

3. Why checkpoint broadcast progress?