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
source share