Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is better H2 or HSQLDB? [closed]

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?

like image 623
dexter Avatar asked Apr 30 '10 16:04

dexter


People also ask

What does H in Hsqldb stand for?

HyperSQL DataBase (HSQLDB) is a modern relational database system that conforms closely to the SQL:2016 Standard and JDBC 4.2 specifications.

Is H2 database good for production?

It can be embedded in Java applications or run in the client-server mode. Mainly, H2 database can be configured to run as inmemory database, which means that data will not persist on the disk. Because of embedded database it is not used for production development, but mostly used for development and testing.

Who uses Hsqldb?

Who uses HSQLDB? 6 companies reportedly use HSQLDB in their tech stacks, including Swingvy, DevOps, and picturesafe media/data/bank GmbH.

What is Hsqldb used for?

HSQLDB is used for development, testing, and deployment of database applications. The main and unique feature of HSQLDB is Standard Compliance. It can provide database access within the user's application process, within an application server, or as a separate server process.


2 Answers

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.

like image 200
Lukas Eder Avatar answered Sep 21 '22 17:09

Lukas Eder


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.

like image 38
trashgod Avatar answered Sep 21 '22 17:09

trashgod