“Storing tweets based on creation time will give us the advantage of fetching all the top tweets quickly and we only have to query a very small set of servers.”
I don’t understand why we can fetch top tweets quickly and only query a very small set of servers.
Because the we still have to go through the steps below
- Our application (app) server will find all the people the user follows.
- App server will send the query to all database servers to find tweets from these people.
- Each database server will find the tweets for each user, sort them by recency and return the top tweets.
- App server will merge all the results and sort them again to return the top results to the user.
Only benefit I can see is reducing the sort time.
Does anyone can help me understand it?