Engineering Decisions · Senior · Question 1 of 14

A social feed serves mostly users with a few hundred followers, plus some accounts with 50M. Reads must be fast. How do you build timelines?

Show the answer

Correct answer: A hybrid: fan-out on write, except for huge accounts

Explanation

Precomputed timelines make reads fast for most accounts, and merging huge accounts at read time avoids millions of writes per post. Pure fan-out on write fits a network with no extreme accounts, but one celebrity post would flood the write path. Pure fan-out on read fits low-read systems and stays simple, but assembling each feed on every open gets too slow at this scale.

Further reading

Problem with a question

Engineering Decisions · Senior · question 1

Test yourself

Take the Engineering Decisions · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz