Fan-out on write and on read

A social feed can be built by pushing each post into every follower's feed at write time, which makes reads cheap, or by gathering posts at read time, which suits accounts with millions of followers. Large systems mix both.

Where it shows up in real systems

  • Pub/sub topic

    Producers publish once without knowing who listens; each subscriber processes the event independently. Fan-out multiplies downstream load by the number of subscribers.

    In production: Amazon SNS, Google Cloud Pub/Sub, Azure Event Grid, NATS

  • Push notification service

    Apple and Google gateways accept large batches but deliver on their own schedule. Fan-out to millions of devices belongs in a queue with many workers, and invalid device tokens must be cleaned up.

    In production: Firebase Cloud Messaging, Apple Push Notification service, Amazon SNS Mobile Push, OneSignal

See it break, then fix it

Build an architecture, send it a day of traffic and outages, and learn why it holds or fails. Free to start.