• Post Reply Bookmark Topic Watch Topic
  • New Topic

advise regarding putting the data in application scope

 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an application in which the data shown on the main page comes from the database and remains static for a period of time. like say 1-2 days, and it changes after that.

Now, since that data is on the main page and will be accessed frequently, i dont want to query the database each and every time.

So, what i plan to do is while starting the application, have a startup servlet, put the data in the application scope and after each day, a thread will run which will take the latest
data from the DB, and replace the data in the application scope..

Now, the problem is that i am not sure how much it will impact the performance if i have put the data in the application scope.

I plan to put around 40-50 rows from a table, having around 4 columns each.

Is it a decent idea to put this much of data in the application scope and not go to the DB every time.

Also, "roughly" how much will the performance be affected?

Any other comments/ideas regarding the same are greatly appreciated.

Thanks,
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless your rows have thousands of columns, this is a miniscule amount of data and will cause no problems.
 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!