H2和 HSQLDB 哪个更好?

HSQLDB 2.0即将发布。我想知道它的性能是否会超过 H2,因为据我所知,大多数用户更喜欢 H2而不是 HSQLDB。我对 HSQLDB 2.0的 MVCC 支持感兴趣。我了解到 H2上的 MVCC 仍处于试验阶段。关于支持/文档、并发性和性能,两者之间哪个更好?

88924 次浏览

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 one and the other are available. They share a common heritage, and both are open source.

Please note I had provided this answer in 2011. It may be outdated

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.

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.

On the other hand, I agree with user trashgod, you should test performance against a reasonable schema and use-case for yourself.