What would be the schema for storing the trie ? Would we use SQL or no-SQL database ?
trie can be design as multi level hashtable. thus, the k v data store is the choice.
My thought is that we should store every query by users in DB or NOSQL storage. Keep trie totally different as a cache. We can always read data from DB and build trie again. Typeahead is not a mission critical functionality in absense of which user will not be able to search
Is it possible to get the answer in one query to the db then?
Key-value db such as DynamoDB would be great fit for storing trie