Search⌘ K
AI Features

Requirements of the Typeahead Suggestion System’s Design

Explore the initial phase of System Design by defining the functional and non-functional requirements for a Typeahead Suggestion System. Calculate precise resource estimations for storage, bandwidth, and servers, ensuring the design meets strict low-latency and scalability constraints.

Requirements

We will design a typeahead suggestion system that meets the following functional and non-functional requirements.

Functional requirements

The system suggests the top NN frequent and relevant terms based on the user’s input. Suggestions can be ranked using context, such as the user's recent searches, and low-confidence suggestions are hidden rather than shown.

Non-functional requirements

  • Low latency: The system must provide suggestions in real time, with latency under 200 ms. Since the average time between keystrokes is 160 ms, the system must respond quickly to remain useful and prevent stale suggestions.

  • Fault tolerance: The system must provide suggestions even if individual components fail. If the ranking model is unavailable, the system falls back to the most frequent prefix completions.

  • Scalability: The system must support an increasing number of users and queries over time.

Resource estimation

Typeahead improves the search experience by suggesting query completions while the user types. Design for a workload comparable to Google Search scale. ...