I am developing a layered web app. In brief it has:
UI: html, javascript and jquery
Domain logic: Java and servlets
Business logic: MySQL
I have large amounts of records in the database containing info about books. In addition the application will be used by a lot of users at the same time. I want to enable users to input a book's "name" in a search text field , say "book1" and display a drop down list using jquery autocomplete.
The records in database are not updatable since they will never change.
Considering solid design patterns,which is better (performance and speed wise) :
Preloading these database records into a cache object at the domain logic and let the users search (query) them from this object? Or querying directly from the database using something like MySQL full-text search?
If using MySQL full-text search, I am concerned about having lots of calls to the database by many users at the same time. As for preloading into a cache object, i am not sure if this is generally a good software practice, does anyone recommend it? Should i put a timer for records to remain cached in memory?
Which of these 2 methods is preferable? are there other better methods for such scenarios?