Detailed Design of Typeahead Suggestion System
Take a deep dive into the detailed design of the typeahead suggestion system.
Detailed design
Let’s understand the flow and interaction of the components shown in the illustration below. Our design is divided into two main parts:
- Suggestion service
- Assembler
Suggestion service
When a user types a query in the search box, at the same time, the getSuggestions(prefix)
API calls hit the suggestions services. The top 10 popular queries are returned from the distributed cache i.e., Redis.
Assembler
We discussed how tries are built, partitioned, and stored in the database in the previous lesson. However, the creation and updation of trie shouldn’t come in the critical path of a user’s query. Therefore, we should not update the ...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy