java - Retrieve all essential data on startup -



in java web application, know if proper (or "standard"?) way essential data such config data, message data, code maintenance data, dropdown option data , etc (assuming data not updated frequently) loaded "static" variables database when server startup.

or more preferred way retrieve data querying db per request?

thanks advice here.

it valid pull out data not going modified during application life-cycle , keep in memory singleton or something.

this idea because saves db hits , retrieval faster. lot of environment specific settings , other data can pulled once , kept in immutable hashmap future request.

in common web-app not have many config data/option objects can eat lot of memory , cause oom. but, if have table hundreds of thousands of config data, better assume pulling objects , when requested. , if do want keep in memory, think of putting in key-value store memcached.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -