Daily Active users: 1 million
Average Posts per User per Day: 2
Average Edits per User per Day: 1
Average Removes per User per Day: 1
User Row: 17 bytes -> 3 400 000 000 -> 3.4 GB
Advertisement Row: 295 bytes -> 295 000 000 bytes -> 295MB per day -> 107GB per year
User Table:
Advertisement Table:
External:
Depending on if the user can add additional custom fields to advertisement, may want to switch from SQL to noSQL
In our case because the fields are strictly Price/Name/Title, we can opt for SQL DB
User Table:
Advertisement Table:
User sends request to either post/delete/update advertisement or get an advertisement
Client sends request to API Gateway where authorization and rate limiting happens
Loadbalanced to servers -> Round robin
Application logic from APIs to execute requests
Update DB if needed
Read heavy because a lot more people looking at posts than posting
If request fails, we can retry (possibly 3 retries) if all attempts fail, we send response letting user know we were unable to make post
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...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
SQL database for strict fields
NoSQL if we allow user to put in varying number of fields and custom fields
Bottleneck:
Category of advertisement
If user wants to get notification for a specific category of advertisements -> we can add a messaging queue (Kafka)
Can also take user feedback and depending on that, can implement features