Best strategy to persist configuration variables of a JSP web aplication?

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:49:57

问题


I'm implementing a web application using java (jsp). Now I'm adding some configuration buttons into the application, and i need to know which is the best strategy to persist them.

For example, I need to add a switch which will tell if each 10 jobs with errors the main worker must be stopped. It is a boolean variable called "safeStop". For that i need to persist if that config value is activated. This persistent value must be there even if the server is reset so it is not enought to persist it on RAM, it mus be persisted on disk.

This application will process thousands of works at day, so I need a safe and efficient way of persisting configuration.

I can't find any coherent info about different strategies of doing this and which is the best option. Any help or strategies will be helpful.

Thank you


回答1:


I think the best practice would be to keep all the conf variables in a database and set a cookie on client side if that data needs to be processed. Once operations are performed update the values on server on session end or after a certain time or data volume or at the end when all processing operations are complete. This way you'll achieve performance, store information on something besides ram while using the RAM for shorter transaction operations



来源:https://stackoverflow.com/questions/41881554/best-strategy-to-persist-configuration-variables-of-a-jsp-web-aplication

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!