High-level Design of Typeahead Suggestion System

Understand the high-level design of the typeahead suggestion system.

High-level design

According to our requirements, the system should not only suggest queries in real-time with minimum latency but should also store the new search queries in the database. This way, the user will get suggestions based on popular and recent searches. Hence, our proposed system should consist of the following parts:

  1. Providing suggestions based on the search history.

  2. Storing the new and trending queries in the database to include them in the suggestion.

When a user starts typing a query, every typed character will hit one of the application servers. Assume that we have a Suggestions service that will obtain the top 10 suggestions from the cache, i.e., Redis, and return them as a response to the client. Moreover, we also have another service known as Assembler that collects the user searches, applies some analytics to rank the searches, and stores them in a NoSQL database distributed across several nodes.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy