Hibernate Single-Byte Databases: Thin Client Configuration

I am debuting a Java Swing application that stores information through Hibernate, currently using PostgreSQL. Now I would like to simplify the configuration of the database on the client, and I am thinking about individual databases. The database that I use is quite small and simple, so there are no special requirements. I only ask that it be stable and reliable.

What are Hibernate compatible solutions? The final application should not have any installation steps, such as installing a database server or so on. The ideal scenario is a ZIP file that is unpacked and everything is ready to work, for example, Eclipse.

Thanks!

+4
source share
2 answers

A Java database such as JavaDB (aka Derby ), HSQLDB or later H2 (author of the original HSQLDB) in native mode are all possible candidates. Between them, JavaDB, as a rule, is considered the most reliable (full ACID, fault tolerance, unlimited db size, etc.) And it will be my choice.

Here is a summary of the reasons:

  • H2 is very interesting and I use it for testing (its compatibility mode is really wonderful), but I'm not sure of its maturity for use in production.

  • H2 and HSQLDB are faster than Derby because they do not synchronize data with the disk when committed - while Derby does. Thus, performance is due to a lack of strength. If you change this behavior, they all hit a bottleneck: the IO drive .

  • HSQLDB only supports dirty reading , transactions see uncommitted values ​​from other transactions.

  • HSQLDB is not completely Atomic , a transaction may be partially (WTF?) Completed

  • Derby is more powerful, has spec-compatible drivers, and scales well.

Make no mistake, I’m not saying that HSQLDB is bad, but you need to know what you are dealing with and in which context / application. Sometimes speed is more important (for example, for unit testing), and sometimes data integrity. If you are in the latter case, Java DB is IMO the best choice.

Some of the links below are 2/3 years old, but I don't know any revolution. If I make a mistake, let me know, I will be happy to update my answer to make it accurate.

References

+6
source

I used HSLQDB in combination with hibernate for a long time. This is a really fast and easy to use application for basic small db requirements.

+1
source

All Articles