User should be able to search public websites based on text.
The system should be able to crawler public website and store results.
The search must be real time.
Return auto-complete/typeahead while user typing the search.
Low latency
Scalability
Eventually consistency
Security
Assume 1B daily active user
Read QPS: 1B / 100k = 10k
Peak read QPS: 2 * 10k = 20k
Storage estimation:
Assume the system crawler 100B website in total. Each website will need to store 100k information for text and images. Storage need: 100B * 100k = 10PB
Each data store needs to have 2 more replicas. In total the storage need is 3 * 10PB = 30PB.
GET getAutoComplete(text)
return a list of strings for auto complete/typeahead. Or return error message if any error.
GET getSearchResults(text)
return the list of website info which matches the search text. Or return error message.
See diagram
See diagram
See diagram
See diagram
See diagram
Our non-functional requirements are scalability, fault tolerance, availability and low latency. Let's discuss how the proposed system fulfills these requirements:
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?