Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6925155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:45:12+00:00 2026-05-27T10:45:12+00:00

I am developing a layered web app. In brief it has: UI: html, javascript

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:45:12+00:00Added an answer on May 27, 2026 at 10:45 am

    I found a solution and hope this answer will help the ones who are dealing with a similar situation:
    I will be using a software engineering design pattern, which I used frequently in the past, called Identity Map.

    Only this time, since records are not updatable (i.e. not changeable), I will be using only the caching functionality of the identity map. So I will will be loading the records from the database into this identity map object once the server starts. This way a user will query them directly from the domain layer, thus faster and less calls to the database.

    One issue to consider, and it is when adding new records by the administration, for this situation I will be using another design pattern called “observer pattern” (you can learn about it in this book).

    UPDATE:
    In case you are dealing with a similar situation, a good idea is to use MySQL indexing. I used it on the column of the “book’s name” to enable faster loading in the cache object, because in my case the cache object will contain only book(s) name(s) since using the search field in the UI, the user is only concerned about a book’s name. PS: other book details will be loaded only when user clicks on a book’s name in the drop down list, and at this point u might want to use another Identity map holding the details . The reason behind this architecture is that, logically speaking never will u have all the books (with their details) from your database searched (loaded) by all the users of your application at the same time… thus to minimize server memory and bandwidth usage you first compromise loading the whole column of book names in memory for faster searching of all available book names BUT their details (ie more space in memory) will be loaded only when needed by a user and will be kept in another identity map to be used by another user searching for the same book with same details. In my opinion this minimizes memory usage on the server and less calls to the database to get details that have already been fetched by other users before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're developing a layered web application. The specs: 3 layers, data layer, business layer,
When developing a new web based application which version of html should you aim
Developing a web application that I've registered with Twitter. In this app, I might
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
When developing whether its Web or Desktop at which point should a developer switch
developing iphone app, I have used a UIImageview and i have set an image
Developing rails has become lots of fun over the year that I've done it,
I'm currently developing an ASP.NET Human Resources System. I'm using a layered architecture with
Developing an app where all tabular data is returned as an object. Some cells
Developing a Struts 2 app I run in a following problem. I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.