在本地文件系统(Java 中)上持久化 ACID 事务的简单方法是什么?
我正在开发一个小型(java)项目,其中网站需要维护注册电子邮件地址的(最好是逗号分隔的)列表,仅此而已,并且能够检查地址是否在列表中。我无法控制托管或服务器缺乏数据库支持。
Prevayler 似乎是一个很好的解决方案,但该网站是一个鬼城,几乎所有应该存在的示例代码都丢失了,所以我有点警惕。
对于此类任务,还有哪些推荐选项?
I'm working on a small (java) project where a website needs to maintain a (preferably comma-separated) list of registered e-mail addresses, nothing else, and be able to check if an address is in the list. I have no control over the hosting or the server's lack of database support.
Prevayler seemed a good solution, but the website is a ghost town, with example code missing from just about everywhere it's supposed to be, so I'm a little wary.
What other options are recommended for such a task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用嵌入式数据库,例如 HSQLDB、H2 或 Derby/JavaDB。它们不需要安装,并且可以使用简单的文件作为存储机制。
Use an embedded database like HSQLDB, H2 or Derby/JavaDB. They need no installation and can use simple files as their storage mechanism.
是的,prevayler 及其历史并发 space4j 确实是这种简单案例的良好候选者。它们比 DB 简单得多,但提供了一些有用的概念并且速度很快(因为实际上 FS 只是内存中数据存储的备份。
Yeah, prevayler and its historical concurrent, space4j, are really good candidates for such a simple case. They're far simpler than DB, provides however some useful concepts and are way fast (since in fact FS is only a backup of the in-memory datastore.
您可能需要考虑 Berkeley DB。
You may want to consider Berkeley DB.