I am building a web application using React on the front end and Ruby on Rails on the backend. I am a newbie developer but am working on a real world project to help local pharmacies better respond to patient medication requests. I was hoping to get some insight on a search box feature I am working to implement.
I want to create this feature so that a patient can search for a medication name as they type into a search box that generates autocomplete suggestions. We are using a dataset of 10,000 medications, so the challenge here is how to deal with this large dataset while making the user experience pleasant. Last thing I want to do is send a request every time a user types in a word to fetch relevant medication names and have it be laggy due to round trip response.
One approach I have thought of was to seed the medications to a Postgres SQL database, then when the patient loads the page with the search box, fetch all the records and maybe use some sort of cache to store on the browser. Rails documentation seems to have some good information on this.
I was also looking into elasticsearch, since I hear its good for large dataset retrievals.
Does anyone have any suggestions on any other concepts or technologies I could explore for the particular feature I want to build without sacrificing user experience?