Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persistence Strategy for Standalone Desktop Java Application

(Only managed to find one other question on this - Object persistence strategy for desktop application)

I have a basic Java Swing application - which needs to access / persist a few thousand POJOs. I may need to run basic queries on these.

Originally I looked at JPA-Hibernate + HSQLDB, but this slows app start-up time and I figured it was overkill for my query requirements.

I simplified my data model and started looking at Document DBs - mongodb is great but it isnt really suited for non-server environments; starting up and shutting down the mongod process from Java (using ProcessBuilder) is fiddly and I really want an embedded solution.

I really want a fast, lightweight persistence tool with basic query functions that can be embedded in a Java app.

Are these the only options?

  • http://prevayler.org/
  • Java Embedded Database (HSQL) without ORM
  • Java Serialization to filesystem
  • JSON persisted to flat files?
  • XStream (and XBird? - http://code.google.com/p/xbird/)
  • OODB
  • JCR Implementation ?

Can anyone offer any other advice / suggestions? At what point would serializing a large List of POJO's start to really hurt performance?

Thanks

edit: Just found this post - https://stackoverflow.com/questions/2825491/are-there-any-embeddable-document-database-engines-for-java-something-similar-t recommending Orient - http://code.google.com/p/orient/

like image 650
Andrew B Avatar asked Apr 08 '26 08:04

Andrew B


1 Answers

I recently used db4o (http://www.db4o.com/) as a data store for a standalone desktop application. Its an object data base which can be run in embedded mode w/o a server running in the background.

like image 163
Stefan Avatar answered Apr 12 '26 05:04

Stefan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!