The critical requirements are:
There could be other features won't be included in the discussion today:
10 million DAU, 5000 peek view QPS.
Assume 20% user tweets, the write QPS could be 1000.
Assume each tweet takes 1KB, the daily storage requirement is 1GB. The overall storage requirement could be TB.
We have the following components:
Tweet flow
View timeline flow
DB sharding and redis cache:
Since we asked for eventual consistency, the replication can be done with a single leader replication, which ensures fast write and fast read from followers, but the asynchronous update to replica would not have strong consistency, which is what we don't have here.
We used microservice to allow each service to be scale independently. i.e. post service can be scale up more than authentication service, as it serves higher load.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?