I know that SQLite is all the rage nowadays (whether that makes sense or not is a different discussion) and I'm wondering if anybody used https://www.h2database.com/html/main.html in some capacity in production workloads? Personally I only used it for unit testing but that's about it.
Announcement that Derby is to be retired. https://issues.apache.org/jira/plugins/servlet/mobile#issue/DERBY-7177
Not H2 but Apache derby (another pure java embedded SQL database). Had some data processing that was OOMing, so spilled it to disk in a temp derby db and then used the SQL to process stuff in smaller chunks
interesting, I forgot about Derby
Ya there's a few embedded ones that are good and pure Java. H2 apparently has some issues where it can corrupt the DB and can't recover, if your application doesn't shut down cleanly. It's also because of that it's really fast I think. Personally I don't really see a reason to use SQLite in Java as compared to HSQLDB or Derby. For in-memory only H2 is good as well, and maybe the fastest of them.
right, that tracks with what I was thinking about: the system I'm working on is sadly using MongoDB for storing relational data - an eventual move to Postgres is going to happen, but in the meantime we have to come up with ways of digging ourselves out of this hole
FWIW, http://cljdoc.org uses SQLite. Works well for it.
It's very anecdotal, but I tried h2 for a small project and found it kind of odd and annoying. ymmv
The only advantage I think SQLite has over Derby and HSQLDB is that the DB is one file that can be easily moved around and is normally very good at being backward compatible. And also you can use it from other languages easily as well since it's very well supported. So if those are properties you like, SQLite can be a good choice.
And maybe I should add, SQLite is likely the most battle tested one which is least likely to lose data as it takes durability really seriously. I believe Derby is next for most likely to be very resilient. HSQLDB and H2 I remember have both had documented bugs and stuff where extreme events could cause lost data or corrupted databases, like power failure mid-transaction and such.
Laaaaate to this party... but I have to plug Gerrit every chance I get :D Gerrit code review is a JVM app that uses H2 by default https://www.gerritcodereview.com/3.0.html And it's hella good software!