持久化JSP Web应用程序配置变量的最佳策略是什么? [英] Best strategy to persist configuration variables of a JSP web aplication?

查看:93
本文介绍了持久化JSP Web应用程序配置变量的最佳策略是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用java(jsp)实现一个Web应用程序。现在,我在应用程序中添加了一些配置按钮,并且我需要知道哪些是坚持它们的最佳策略。



例如,我需要添加一个开关,用于判断每个10个有主错误的作业是否必须停止。它是一个名为safeStop的布尔变量。为此,我需要坚持,如果配置值被激活。这个永久值必须在那里,即使服务器被重置,所以它不足以将它保存在RAM上,它可以保存在磁盘上。



这个应用程序将处理数千因此我需要一种安全有效的持久配置方式。



我无法找到任何有关执行此操作的不同策略的连贯信息,哪些是最好的选择。任何帮助或策略都会有所帮助。



谢谢 我认为最好的做法是将所有conf变量保存在数据库中,并在客户端设置一个cookie,如果需要处理这些数据的话。一旦执行操作,在会话结束时或在特定时间或数据量后更新服务器上的值,或在所有处理操作完成时更新。通过这种方式,您可以实现性能,将信息存储在RAM之外的内存中,同时将RAM用于较短的事务操作。


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

解决方案

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

这篇关于持久化JSP Web应用程序配置变量的最佳策略是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆