Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java embedded database w/ ability to store as one file

I need to create a storage file format for some simple data in a tabular format, was trying to use HDF5 but have just about given up due to some issues, and I'd like to reexamine the use of embedded databases to see if they are fast enough for my application.

Is there a reputable embedded Java database out there that has the option to store data in one file? The only one I'm aware of is SQLite (Java bindings available). I tried H2 and HSQLDB but out of the box they seem to create several files, and it is highly desirable for me to have a database in one file.

edit: reasonably fast performance is important. Object storage is not; for performance concerns I only need to store integers and BLOBs. (+ some strings but nothing performance critical)

edit 2: storage data efficiency is important for larger datasets, so XML is out.

like image 889
Jason S Avatar asked Jul 21 '09 17:07

Jason S


People also ask

What is a Java embedded database?

An embedded database means that the database is integrated as an inseparable part of an application software. A Java application, in particular, accesses the database using a JDBC driver. The database engine runs as a cohort inside the same JVM while the application is running.

How does embedded database work?

An embedded database is a database technology in which database management solutions are built into an application rather than provided as standalone tools. In many cases, this effectively "hides" the database management tools from the end user.

Which embedded database is best?

Also SQLite is the Database chosen by virtually all mobile operating systems. Android, Iphone OS and Symbian ship with SQLite which makes me think that manpower was spent to optimize it for the processor in those phones (nearly always ARM).

Why H2 is not used in production?

The main reasons not to use H2 (or HSQLDB, or Derby) for production are: Probability of critical bugs: compared to the 'big' databases Oracle, IBM DB 2, MS SQL Server, MySQL, PostgreSQL, the Java databases are relatively new and therefore possibly not as stable (have bugs).


2 Answers

Nitrite Database http://www.dizitart.org/nitrite-database.html

NOsql Object (NO2 a.k.a Nitrite) database is an open source nosql embedded document store written in Java with MongoDB like API. It supports both in-memory and single file based persistent store.

like image 64
Doua Beri Avatar answered Oct 02 '22 17:10

Doua Beri


H2 uses only one file, if you use the latest H2 build with the PAGE_STORE option. It's a new feature, so it might not be solid.

like image 40
Steve McLeod Avatar answered Oct 02 '22 15:10

Steve McLeod