Fanout on Write vs Read: How Social Media Feeds Scale to Millions
Social media platforms face a core system design challenge when building news feeds for hundreds of millions of users: deciding whether to assemble a user's feed at write time or read time. Fanout on write precomputes feeds by pushing new posts into each follower's feed immediately, making reads fast but placing heavy cost on writes and storage. Fanout on read assembles the feed on demand when a user opens the app, keeping writes cheap but making reads slow and expensive at scale. High-follower accounts, such as celebrities, create a 'write storm' problem that makes pure fanout on write unworkable, leading platforms like Meta, Twitter, and Instagram to adopt a hybrid approach. In this hybrid model, normal accounts use write fanout for fast reads, while posts from very large accounts are pulled in at read time and merged into the precomputed feed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in