Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lightest Database to be packed with an application

I am developing a Java Desktop Application and want a light database that can be used with Hibernate and that can be packed with an application.

I was going to use Derby database. It's size is near 2 MB. But before that I wanted to have views of experts on SO.

Will it work with Hibernate?

Actually, I am new to Hibernate and was studying that it requires a Dialect for a database so Is Hibernate has dialect for Derby?

like image 532
Yatendra Avatar asked Mar 12 '10 09:03

Yatendra


People also ask

Which is the lightest database?

SQLite is very lightweight compared to other database management systems like SQL Server, or Oracle. It has an in-memory library that you can call and use directly without installation or configuration. You do not require any dedicated server to store database. The database is stored in the hard disk of a computer.

Which database should I use for my application?

PostgreSQL. A unique relational database, PostgreSQL is the best database for Android and iOS apps. Developers can customize this database as they want; that's why it's the most preferred mobile app database.

Which database is best for Android application?

Due to its inclusion in the Android Software Development Kit (SDK), SQLite, an open-source relational database, is the most common database technology associated with Android applications. For Android apps, SQLite is most often paired with Room, a framework for managing the lifecycle of objects.


2 Answers

JavaDB (Sun's supported distribution of the open source Apache Derby), HSQLDB (not very active) and H2 (the successor of HSQLDB) are all 100% Java embeddable database engines and can all be used with Hibernate (i.e. there are dialect for them). Refer to this page and this one.

HSQLDB has the smallest footprint (~700 KB) of all of them. But feature wise (see this comparison), H2 is the clear winner and its footprint (~1 MB) is still smaller than Derby's one (~2 MB).

The final choice depends on what you need but H2 is a good compromise of features and size (in other words, a big competitor). Have a look at the mentioned comparison.

like image 86
Pascal Thivent Avatar answered Oct 04 '22 09:10

Pascal Thivent


I would recommend HSQLDB. It is small and fast and runs fine with Hibernate. Hibernate has a dialect for the Derby DB as well (haven't used it though and I think it is not officially supported by Hibernate yet).

like image 43
Daff Avatar answered Oct 04 '22 09:10

Daff