Provide suggestions to users
Low latency
Reliability
Scalability
Availability
1 billion Daily Users and each user hits 10 queries per day on an avg
10 billion queries/day
(10 billion / 24*60*60) QPS
Use tries
For database, we can use multiple databases for different use cases. For storing user metadata, use MySQL. And for query and suggestions, use NoSQL.
Clients start typing in the browser search bar. The request goes to load balancer, which sends it to the web server. Web server checks in the cache and if not there then sends the request to the application server. Then it checks the cache, if not there then fetches data from the database. And returns to the end user.
Clients start typing in the browser search bar. The request goes to load balancer, which sends it to the web server. Web server checks in the cache and if not there then sends the request to the application server. Then it checks the cache, if not there then fetches data from the database. And returns to the end user.
Databases will internally use a trie datastructure to store and retrieve suggestions
Explain any trade offs you have made and why you made certain tech choices...
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?