I'm working on a php project which uses Mysql, javascrit and jquery as technologies.
In there I need to provide the auto suggestions option to the users when they are typing on the text box to search products by name.
Current implementation loads all the product names from the database as a json string when the page is load and then filter the string according to the inputs. This is inefficient when there are large number of names(about 100,000 Names) available in the database.
I need to change this logic. I need to retrieve the names from the database using ajax requests at the same time when the user is typing on the text box. Ex- Initially no names are available at the suggestion list. Then when user type "A" the application should send a ajax request to the database and then retrieve all the names containing "A" letter and get it as a json string.
But the problem with this method is we have to do lots of database accesses and get the response as the speed of typing to show as suggestions.
Is there any technique which I can use to make efficient this ajax database access. Can someone please help me on this problem.
Thanks in Advance.