本地存储的数据库
我正在寻找一个数据库,我可以用它来存储某些股票多年来的数据。可能会有几千条记录。我正在用 Java 和 Clojure 编写一个应用程序,当需要显示数据时,它将从本地数据库中提取数据。
我想知道是否有人知道用于此目的的良好数据库?我只有在服务器端运行 MySQL 的经验。
在 Clojure 和 Java 中哪个数据库最容易用于本地存储?
谢谢,
亚当
I am looking for a database which I can use to store data about certain stock over a number of years. There will probably be a few thousand records. I am writing an application in Java and Clojure which will pull out data from this local database when required to display the data.
I was wondering if anyone knew of a good database to work with for this purpose? I only have experience with MySQL running on the server side.
Which database would be easiest to work with in Clojure and Java for local storage?
Thanks,
Adam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
JDK 6 及更高版本与 Java DB 捆绑在一起,这足以满足您的用例。
JDK 6 and greater comes bundled with Java DB which good enough for your use case.
对于这种小型应用程序,如果您选择众多好的嵌入式 Java 之一,那么几乎肯定是最简单的数据库。
我个人的首选可能是:
之后,您应该能够很容易使用它们使用标准的 JDBC 工具集,因此与 MySQL 没有太大区别。
如果您正在寻找一个非常好的 DSL 来通过 Clojure 与 SQL 数据库交互,那么您绝对应该看看 Korma。
For this kind of small-scale application it will almost certainly be easiest if you pick one of the many good embedded Java databases.
My personal top choices would probably be:
After that, you should be able to use them pretty easily using the standard JDBC toolset, so not much different from MySQL.
If you're after a really nice DSL for interfacing with SQL databases with Clojure, you should definitely also take a look at Korma.
我已经将 Apache Derby 用于类似的应用程序(尽管主要是用 Java 编写的)。他们已经运行该系统近四年了,并使用它执行了 60,000 多笔交易,没有出现任何重大问题。只是我偶尔会遇到错误。
Derby 与 JavaDB 是相同的数据库,但是使用 Derby 可以更轻松地跟上版本,因为您可以将其作为依赖项包含进来,而不是等待下一版 JDK 版本的发布。
另外,IIRC、JavaDB 仅包含在 JDK 中,而不包含在 JRE 中。
I have used Apache Derby for a similar application (although written mostly in Java). They have been running it for almost four years now, and performed more than 60,000 transactions with it with no major problems. Only the occasional bug on my part.
Derby is the same database as JavaDB, however with Derby its easier to keep up on the releases as you can just include it as a dependency, rather than wait on the whim of when the next JDK rev is coming out.
Also, IIRC, JavaDB is only included with JDK, not the JRE.
根据您的数据和应用程序的性质以及您使用新数据库模式的意愿和/或限制,您可能还需要考虑面向文档的数据库之一:MongoDB 或 CouchDB。如果您的数据和应用程序是面向 SQL 的,请使用建议的数据库之一。
Depending on the nature of your data and application and your willingness and/or constraints in working with a new database modality, you might also want to consider one of the document-oriented databases, MongoDB or CouchDB. If your data and application are SQL oriented, use one of the databases suggested.