Fan-out on write
Definition
Fan-out on write copies (or references) each new item into the stored feed of every recipient at write time, trading extra writes for cheap reads.
In practice
Feeds are read far more often than written, so precomputing them makes the common path fast: a home timeline is one read of a list from a cache. Writes are handled asynchronously by workers that take a post from a topic and append its id to each follower's timeline, sharded across cache nodes.
Write amplification is the problem. A user with 20 million followers turns one post into 20 million timeline writes, delaying delivery and loading the cache (the celebrity problem). Most designs go hybrid: push posts from ordinary users, and merge posts from very large accounts at read time. Timelines for inactive users are often skipped and rebuilt on demand.
Example
A user with 300 followers posts; workers append the post id to 300 Redis lists capped at 800 entries, and each follower's feed loads with one LRANGE.