Anyone ever tried to use Derby or HSQLDB in a production environment? Any good, bad or ugly experiences?
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.
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.
There is a comparison of embedded databases on the H2 website (H2 is another embedded Java DB that is very fast, BTW):
This should give you some facts.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With