Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database for local storage

I am looking for a database which I can use to store data about certain stock over a number of years. There will probably be a few thousand records. I am writing an application in Java and Clojure which will pull out data from this local database when required to display the data.

I was wondering if anyone knew of a good database to work with for this purpose? I only have experience with MySQL running on the server side.

Which database would be easiest to work with in Clojure and Java for local storage?

Thanks,

Adam

like image 780
adamjmarkham Avatar asked Jan 11 '12 00:01

adamjmarkham


4 Answers

JDK 6 and greater comes bundled with Java DB which good enough for your use case.

like image 93
Aravind Yarram Avatar answered Oct 17 '22 21:10

Aravind Yarram


For this kind of small-scale application it will almost certainly be easiest if you pick one of the many good embedded Java databases.

My personal top choices would probably be:

  • H2 - probably the best performance pure Java database overall, and if you believe their benchmarks then it is considerably faster than MySQL and indeed most other databases when run in a single machine environment.
  • Apache Derby - good all rounder, mature and well supported (Oracle have included a version branded as Java DB in recent JDKs)

After that, you should be able to use them pretty easily using the standard JDBC toolset, so not much different from MySQL.

If you're after a really nice DSL for interfacing with SQL databases with Clojure, you should definitely also take a look at Korma.

like image 34
mikera Avatar answered Oct 17 '22 23:10

mikera


I have used Apache Derby for a similar application (although written mostly in Java). They have been running it for almost four years now, and performed more than 60,000 transactions with it with no major problems. Only the occasional bug on my part.

Derby is the same database as JavaDB, however with Derby its easier to keep up on the releases as you can just include it as a dependency, rather than wait on the whim of when the next JDK rev is coming out.

Also, IIRC, JavaDB is only included with JDK, not the JRE.

like image 26
Bill Avatar answered Oct 17 '22 21:10

Bill


Depending on the nature of your data and application and your willingness and/or constraints in working with a new database modality, you might also want to consider one of the document-oriented databases, MongoDB or CouchDB. If your data and application are SQL oriented, use one of the databases suggested.

like image 2
octopusgrabbus Avatar answered Oct 17 '22 23:10

octopusgrabbus