Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Experience using Derby or HSQL in production mode [closed]

Tags:

derby

hsqldb

Anyone ever tried to use Derby or HSQLDB in a production environment? Any good, bad or ugly experiences?

like image 427
tellme Avatar asked Feb 27 '09 11:02

tellme


People also ask

How do I connect to Derby database in Windows?

connect 'jdbc:derby:c:\temp\db\FAQ\db'; If you want to connect to a Derby database which is running in server mode then you can use the following command. connect 'jdbc:derby://localhost:1527/c:\temp\db\FAQ\db;create=true'; To disconnect from the database.

Is Derby an in-memory database?

For testing and developing applications, or for processing transient or reproducible data, you can use Derby's in-memory database facility. An in-memory database resides completely in main memory, not in the file system.


2 Answers

There is a comparison of embedded databases on the H2 website (H2 is another embedded Java DB that is very fast, BTW):

  • Feature comparison
  • Performance comparison

This should give you some facts.

like image 149
Alexander Klimetschek Avatar answered Sep 28 '22 01:09

Alexander Klimetschek


I used HSQLDB in production for reconciliation application. It scaled well till half a million records, DB size was nearly 2 GB.

Good
1) You can tune memory. Initially we were running with 2GB of heap and later increased to 4GB of memory. You can tune memory for CPU quite well. We had different configurations. 15 minutes of execution with 512MB and 2 minutes execution with 4GB of RAM.

2) Fall back to disk based. Later we switched to file based table, and we reduced our heap from 4GB to 512MB. But program doesn't require any change other than memory related configuration.

Nice to have. 1) Shutdown took extra time on windows when memory allotted was low. 2) There is little bit of black-magic with index. Once we added index on more than 6 columns on half a million records. Process was quite slow, we removed additional index. It didn't hurt us.

Overall I strongly recommend HSQLDB when number of records are less than few million, and DB size less than 10GB. It may work even for higher need, but I don't think they could be straight forward. May be additional document may help.

BTW, Fredt was very swift for my questions in mailing list.

like image 45
Mohan Narayanaswamy Avatar answered Sep 28 '22 00:09

Mohan Narayanaswamy