持久化JSP Web应用程序配置变量的最佳策略是什么?

编程入门 行业动态 更新时间:2024-10-25 20:25:06
本文介绍了持久化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应用程序配置变量的最佳策略是什么?

本文发布于:2023-11-05 04:02:49,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变量   应用程序   持久   策略   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!