• Post Reply Bookmark Topic Watch Topic
  • New Topic

Database or Property Files  RSS feed

 
chicha sonu
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the Following Is the Better Option
1)Reading the Key Value from propertyFile
2) Reading the Same from Database
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37250
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chicha,
While the property file will likely be faster, this isn't data you read in frequently. I think you should go with what makes sense. Do you expect the properties to change frequently independent of the application.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"better option" in a vacuum can't be answered. Better how? speed? disk space? how often will it change? How complicated is the data? Is security an issue? and probably a hundred other questions need to be answered. THEN you need to decide what is more important, since any decision will require some kind of trade-off.
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are talking about configuration data then the answer is Memory. Once you have it in memory, how it gets there is irrelevant from a performance POV.

Configuration data is generally small enough that there is not a big penalty in keeping it in memory. Also, since configuration data is accessed much more often than it is changed, keeping it in memory provides a lot more advantages.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!