Estimate the scale of the system you are going to design...
// User should be able to view paragraph/images/videos...
//User should be able to post paragraph/images/videos...
{text=String, date=timeStamp, image=Image1.....}
//User should be able to follow a user
// user should be to like and reply a post
{text=String, date = timeStamp}
Client make a get request to api gateway, which will be route to new query service, this would query from news db which is sql containing a media url link. Any media will then be query from amazon S3 which allow media to be as a link
post request to make a new news/video/image, this would be route to media dabase and store accordingly
reply will be hadle with reply service which can be in store in replies database
Follow will be handle with the following service which will in a graph DB.
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
faster search -> elasticSearch (fasten the search, and search by text)
Post --> message que
cache query at the news query service
CDN at the client server (same region to speed up to query)
horizontal scaling, weighted round robin
Fan out write - client initiated write, newsfeed precomputed when client is doing the wrtie (at the post time) -> prioiritze the read speed. User get request will be fast
For user that has a very large amount of followers
news in generated a read time, we fan out load instead
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?