I was asked this question in one of the system design rounds recently at Google which I could not answer properly and would need guidance on:
Assuming you have architected a very popular app (similar to i_n_s_t_a_g_r_a_m) and you have a lot of users now.
How will you architect timeline generation function for such an app?
Also how will it take care of a scenario where a celebrity has millions of followers (say President of a country), how will you make sure that each of the follower does not receive these updates with too much latency.
Based on my reading in the Designing Data Intensive Applications book, I proposed the following strategies to take care of this scenario:
These details about active users and not-so active subscribers can be found through offline analytics.
The interviewer went into the calculation of the timeline further - say if the number of followers are one million in same region and one million in other parts of the world, how to make sure that the :
How many machines would we need? (Say we have an octa core machine)
I mentioned that we can assume that there are 4 threads of the timeline service running on a machine (assuming four threads are there for download and upload service) and each thread can accept upto 1K connections per minute.
This way we would need more than hundreds of machines to do so.
The interviewer was not satisfied with the answer.
Any suggestions on