Monday, October 18, 2004

Simple and small

When I want to learn a new technology, most probably I end up creating a small application as an example. I think it's the best way to learn. So far, whenever I needed a database for that purposes I chose MySQL. It's fast, easy to set up and it's already installed in my Linux box.
However, from now on, I think I'll be using HSQLDB instead. For those of you that don't know, HSQLDB is a relational database, written in java. Its purpose is not to compete with the other major relational databases like oracle, MySQL, etc. Quoting from its website : It is best known for its small size, ability to execute completely in memory and its speed. To those characteristics, I would add another: Simplicity. Installing it, is as simple as copying a Jar to the filesystem. Running it, is as simple as getting a connection through JDBC (there are other ways, but all of them are quite simple to use).
Another example of its simplicity is the way HSQLDB stores information on disc: data is written as text files containing SQL code. The next time the database starts, the script is loaded into memory, creating the tables, inserting elements, etc. Creative :) But, this approach also has its limitations...it can eat up all your memory if your database is too big. Of course, this is not suited for that kind of applications, and as such with small databases it can be quite efficient.

0 comentários: