Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

best web database solution for scala for a high traffic site? [closed]

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?

like image 268
egervari Avatar asked May 31 '10 22:05

egervari


1 Answers

  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.
like image 196
Vasil Remeniuk Avatar answered Sep 28 '22 01:09

Vasil Remeniuk