Java H2 和 HSQLDB 哪个更好?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2746201/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which is better H2 or HSQLDB?
提问by dexter
HSQLDB 2.0 is soon to be released. I wonder if it will outperform H2 since, as far as I know, most users prefer H2 than HSQLDB. I am interested in the MVCC support of HSQLDB 2.0. I have learned that MVCC on H2 is still experimental. With regards to support/documentation, concurrency, performance, which is better between the two?
HSQLDB 2.0 即将发布。我想知道它是否会胜过 H2,因为据我所知,大多数用户更喜欢 H2 而不是 HSQLDB。我对 HSQLDB 2.0 的 MVCC 支持感兴趣。我了解到 H2 上的 MVCC 仍处于试验阶段。关于支持/文档、并发性、性能,两者之间哪个更好?
回答by trashgod
Both HyperSQL
and H2 Database
are fairly transparent, so testing may be the best approach to determine which is more suitable for a particular use. Comparisons involving oneand the otherare available. They share a common heritage, and both are opensource.
HyperSQL
和两者H2 Database
都相当透明,因此测试可能是确定哪个更适合特定用途的最佳方法。可以进行涉及一个和另一个的比较。他们都有一个共同的遗产,又都是开放源码。
回答by Lukas Eder
Please note I had provided this answer in 2011. It may be outdated
请注意我在 2011 年提供了这个答案。它可能已经过时
My company develops a database abstraction library (jOOQ), which supports both databases. Our integration tests cover a lot of functionality, including the calling of stored procedures and functions, arrays, nested selects, etc. I experience HSQLDB 2.1
to be slightly faster than H2 1.3
for small databases as far as DML is concerned.
我公司开发了一个数据库抽象库(jOOQ),它支持两种数据库。我们的集成测试涵盖了很多功能,包括调用存储过程和函数、数组、嵌套选择等。就 DML 而言,我体验HSQLDB 2.1
到比H2 1.3
小型数据库稍微快一些。
However, HSQLDB highly outperforms H2 in DDL operations as well as when starting/shutting down the instance, even for a small database (due to H2's compiling stored functions afresh with javac at every database startup!). This depends on the way you store stored functions. Apparently, that's a rather jOOQ-specific "issue", see also Thomas Mueller's comment.
但是,HSQLDB 在 DDL 操作以及启动/关闭实例时的性能都远远优于 H2,即使对于小型数据库也是如此(因为 H2 在每次数据库启动时都使用 javac 重新编译存储的函数!)。这取决于您存储存储函数的方式。显然,这是一个相当 jOOQ 特定的“问题”,另见 Thomas Mueller 的评论。
On the other hand, I agree with user trashgod, you should test performance against a reasonable schema and use-case for yourself.
另一方面,我同意用户trashgod 的观点,您应该根据合理的架构和用例为自己测试性能。