Wednesday, October 18, 2006

Another simple and small

A while ago I reviewed HSQLDB, a small and fast java database. I've used it a few times quite successfully. I'm now developing a java desktop application and I needed a small in-memory database and the first choice was obviously HSQLDB. However, I decided to do some investigation to see what else is there. And surprisingly I stumbled upon HSQLDB apparent successor: H2. Quoted from their website:

The development of H2 was started in May 2004, but it was first published on December 14th 2005. The author of H2, Thomas Mueller, is also the original developer of Hypersonic SQL. In 2001, he joined PointBase Inc. where he created PointBase Micro. At that point, he had to discontinue Hypersonic SQL, but then the HSQLDB Group was formed to continued to work on the Hypersonic SQL codebase. The name H2 stands for Hypersonic 2; however H2 does not share any code with Hypersonic SQL or HSQLDB. H2 is built from scratch.

According to this, it's also faster than HSQLDB, which is always good. And after reading the documentation H2 feels more solid and robust. Maybe, it's because it has a few interesting features like cluster support, encrypted database and recovery tool. Also, data is not stored in text files with SQL inside, as with HSQLDB, which it always felt a bit clumsy to me.
I also like the provided SQL console: it's a web application that you can launch directly from the database jar. It could be more complete, but it works well and I specially like the auto-completion feature.
So, for now, I will be using H2 in my application and see if it's as reliable as it seems.