Thursday, 16 March 2017

How to get a faster typeahead (autocomplete) in Nodejs from MSSQL database?

I have plugged in [Bootstrap ajax-typeahead][1] https://github.com/biggora/bootstrap-ajax-typeahead for autocomplete with MSSQL server database that has about 1 million rows. The issues is that it's very slow since it queries for every keyup change and sometime database is disconnected when a user type-in too fast. I was thinking about querying one time when loading up a page and save all rows into a variable to search a keyword from that variable instead of querying too often from database. However, it would use too memory to save all rows into a variable. How does Youtube, Google, Stackoverflow, Quora, and Facebook use autocomplete from a big database?



via Steven Jin

No comments:

Post a Comment