What is Fanout in Social Media Systems
You'll learn: What fanout means and how it distributes posts to followers' feeds when users publish content.
The Core Concept
Fanout is the process of delivering a newly published post to all followers' feeds. When Alice posts a photo, the system must somehow make that post appear in Bob's, Charlie's, and thousands of other followers' timelines. Think of it like a teacher handing out copies of an assignment to every student in the class—one source document fans out to many recipients.
The term "fanout" captures the one-to-many distribution pattern: one post radiates outward to N followers' feeds.
How Fanout Relates to Feed Models
The fanout happens at different times depending on your architecture:
-
Push Model (Write-Time Fanout): When Alice publishes, the system immediately writes her post to all followers' feed storage. The fanout happens during the write operation.
-
Pull Model (Read-Time Fanout): No immediate distribution. When Bob opens his feed, the system queries "who does Bob follow?" and assembles his feed. The fanout logic runs at read time.
-
Hybrid Model: Celebrities trigger read-time fanout, while regular users trigger write-time fanout.
Why It Matters
Fanout is one of the most expensive operations in social media systems. A user with 10 million followers creates 10 million fanout writes in a push model. Understanding fanout helps you choose between push, pull, or hybrid architectures based on your traffic patterns and the celebrity problem.
Key Takeaway:
Fanout is the distribution mechanism that delivers one post to many followers' feeds—it's either done eagerly at write-time (push) or lazily at read-time (pull), and choosing when to fanout determines your system's scalability characteristics.