Embedded database for Scala

1,678 views
Skip to first unread message

Agustin

unread,
Apr 17, 2013, 11:37:59 AM4/17/13
to scala...@googlegroups.com

Hi all.
I would like to know which is the best embedded database for scala. I need to develop a little desktop application with a local database connection and I think that postgreSql is too much for that.
I have heard about HSQLDB, H2 and Apache Derby.

Thanks!


Brian Schlining

unread,
Apr 17, 2013, 12:08:01 PM4/17/13
to Agustin, scala...@googlegroups.com
I would like to know which is the best embedded database for scala. I need to develop a little desktop application with a local database connection and I think that postgreSql is too much for that.
I have heard about HSQLDB, H2 and Apache Derby.
I use Derby for a number of projects that require a local database connection, and it's a great database. I've found it to be extremely reliable. I've used H2 somewhat less, but it works fine too. If your application doesn't need any relatively esoteric features, either should suit your needs. (I can't speak to HSQLDB as I've never used it.)


-- 
Brian Schlining 

Naftoli Gugenheim

unread,
Apr 17, 2013, 6:32:20 PM4/17/13
to Brian Schlining, Agustin, scala-user
I think H2 is supposed to replace HSQL, no?
I've used H2 and heard it's a lot better than Derby but I don't really know firsthand.




--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Sarah Gerweck

unread,
Apr 17, 2013, 8:21:27 PM4/17/13
to scala...@googlegroups.com
I've used HSQLDB in a lot of projects and always been very happy with it. It's lightweight, quick, flexible, and probably the most widely used of the three. It also seems to be the most sophisticated: for example, it's the only one of the three that has fully supported MVCC. (H2 has MVCC, but it's disabled by default and "not fully tested.") 

HSQLDB also has great dialect support so you can share code with other databases, and I love that it has a storage format that is just a SQL script that creates all the tables: it's extremely useful for debugging and testing.

H2 does have full-text search and ODBC support if those are valuable to you. I don't know of any real arguments for using Derby.

Based on my experiences, I would definitely recommend HSQLDB—but I don't have any reason to recommend against the other two.

—Sarah

Dinotzar Tzar

unread,
Apr 18, 2013, 2:11:13 AM4/18/13
to Agustin, scala...@googlegroups.com


I recommend H2 (but your other dbs are fine too).

I would also like to mention Squeryl (http://squeryl.org/), a wonderful ORM-ish Scala library. (Squeryl uses H2 for many of its unit tests, I reckon.)

D.
 

Răzvan Panda

unread,
Dec 24, 2013, 6:49:15 PM12/24/13
to scala...@googlegroups.com

Sebastian Nozzi

unread,
Dec 27, 2013, 3:39:29 PM12/27/13
to scala...@googlegroups.com
I think it depends on how well supported it is by your DB-library / ORM... Are you using any?

(E.g. I am using H2 for acceptance-tests with Squeryl and ActiveRecord)

Sam Lee

unread,
Dec 27, 2013, 5:32:58 PM12/27/13
to Sebastian Nozzi, scala-user
lucene?


Reply all
Reply to author
Forward
0 new messages