Как создать функцию автозаполнения?

#trie #application-design #web-application-design

#trie #приложение-дизайн #веб-приложение-дизайн

Вопрос:

Такие функции, как Автозаполнение Google

Например, у меня есть поле под названием «Имена людей», когда пользователь вводит его, мы покажем все параметры, которые соответствуют вводимым пользователем данным.

Мой первый вопрос:

 which one should maintain trie tree, frontend, backend or both?
  

Второй вопрос:

 No matter front end or back end, when will trie tree be loaded?
If trie loaded on start, million of entities loaded take a lot time, and huge data in memory.
If trie loaded once user searched, each time user typed is a DB call and a Rest call, which also consumme a lot resources. And at first search, user will see no options till he did once, which is bad user experience.
  

Если у вас есть идеи, с нетерпением ждем их!