Twitter fanout design

Viewed 1353

I am reading book 'Designing Data-Intensive Applications' by Martin Kleppmann. At one point author has explained different approaches Twitter takes to publish tweets(fanout) to users. As per one of the approach, when someone posts a tweet, Twitter adds this tweet to a home timeline cache for all of the followers of the poster, as shown in image below. enter image description here

Does it mean Twitter maintains a live cache for all of its users who are followers of someone? Won't it be too many caches to maintain?

1 Answers

Too many cache entries and not too many caches, precisely equal to total number of users.

So that would require TBs of cache approximately and with usage of commodity hardware can be served well on read path but upon write it will have high write amplification for celebrity.

But from maintenance perspective it won’t be an issue but from cost perspective it will.

Related