views:

175

answers:

2

I am in charge of a rebuilding a website that gets about 250,000 visitors a day. We'd like to use Scala, but it does not work very well with Spring (in some minor cases) and Hibernate (there is a major and very annoying mismatch here if you want to use scala collections, which we do).

The application itself is going to have about 40-50 tables.

Other than Hibernate, is there an ORM that works awesome with Scala and is as performant and reliable as Hibernate? Does it also have the same capabilities, or are we going to run into leaky-abstractions if we don't use Hibernate?

It would be a big risk for us to go with a framework that is newer and doesn't seem to have a lot of industry backing... and at the same time, Hibernate is a real pain to program against when using Scala.

1) The Java Collection <-> Scala Collection is absolutely painful. There is a lot more boilerplate and crap to write.

2) The IDE doesn't import JavaConversions and java interfaces automatically... so we this needs to be done manually. Optimizing Imports in IDEA is going to destroy all the manual work.

3) There is also a performance cost to converting back and forth all the time in your domain objects and your dao classes.

4) Not to mention there needs to be a lot of casting, which produces code ugly as sin.

I actually would love to write my own orm that is 100% tailored to scala, but obviously this is really outside of the scope of our project for now.

So what is the best approach?

+4  A: 

Take a look at Circumflex. An ORM written in Scala, for Scala.

KushalP
How many people are using this? Any success stories? What is the likelihood it's going to be around in a month? a year? :/
egervari
The source is readily available on GitHub (link at the end), but as with all open-source projects you just don't know whether the authors will give up. It's a risk you take (apart from ASF projects).I've personally been using it for small internal projects and have found it to be useful. It's concise and simple, which make it perfect as a framework in my eyes.GitHub URL: http://github.com/inca/circumflex
KushalP
+4  A: 
  1. Did you consider Lift Framework? It has a very good persistence module - Lift Record (implementation of the ActiveRecord concept in Scala you're searching for).
    Also, in case you decide to use NOSQL (which may satisfy your demands of a high throughput much better than traditional RDBMS), Lift has modules for Mongo DB, Redis and Couch.
  2. Another proven ORM solution for Scala is JPA. You can freely use JPA annotations in Scala.

    The both solutions are quite reliable and have enterprise support (as far as I know).

    P.S. Worth to mention - Lift Framework is a kind of an industry standard for Scala web-frameworks these days. It has a proven reputation, and some good getting-started books are already available.
Vasil Remeniuk
With all respect to David and the rest of the lift community, it really doesn't appeal to me. Things are just weird, and it's too different. There are things that just jump out and look inconsistent as well. I tried it a few times many months ago... but the code base kept evolving, and example "get started" apps didn't work all the time because they were written just a month or two before the next release. And with scala 2.8, things are going to change even more. I want some more conventional - lean, efficient, clean, concise, and also conventional.
egervari
You want something different than the existing and widely used web-app frameworks such as Grails and Lift and that is simultaneously conventional?
Randall Schulz