Nine Hundred Thousand Writes

The numbers from the Twitter case study in DDIA chapter 1:

metric value
post tweet, average 4,600 requests per second
post tweet, peak 12,000 requests per second
home timeline reads 300,000 requests per second
followers per user, average 75

If every post is fanned out to a materialized timeline per follower at write time, what write rate must the fan-out service sustain at peak, and how does that compare with the read rate the pull design has to serve?

A

12,000 writes per second, the same as the posting rate, because fan-out writes one timeline entry per post and the follower list is stored beside it

B

12,000×75=900,00012{,}000 \times 75 = 900{,}000 timeline writes per second at peak against 300,000 reads per second, so push moves three times more operations at peak than pull does, but each one is a cheap sequential insert instead of a fan-in query

C

4,600×75=345,0004{,}600 \times 75 = 345{,}000 timeline writes per second, since peak posting rate is a burst that the fan-out queue absorbs and amortizes back to the average

D

300,000×75=22,500,000300{,}000 \times 75 = 22{,}500{,}000 writes per second, since a timeline entry has to be written once per follower for every read that requests it