views:

47

answers:

2

I'm looking for some advice/feedback about using different languages in a layered architecture. Right now the architecture in question is an all java stack (db, middle tier, and web tier) using Spring to tie everything together. We've been tossing around the idea of using Ruby on Rails for the web tier, but I'd like to know if anyone has done this before (maybe with different languages/technologies). The idea behind switching to RoR is to increase development speed in the web tier, however my initial analysis is that it will also decrease development speed in the middle tier.

Some of the questions I'm trying to get data points on are:

  • Have any small development teams actually used a hybrid language approach in a similar architecture?
  • Why did you use that approach? What worked well and what didn't?
  • How would you handle interfaces and models (maybe use something like Google protocol buffers or Apache Thrift)?
  • Are there any other benefits or pitfalls to using an approach like this?
+1  A: 

This presentation will probably be interesting to you: Rails on Spring - Using JRuby as the Secret Sauce

Patrick Klingemann
+1  A: 

While I have no experience of RoR, we have taken a similar approach with Django as a front end layer, where we would use java based services for high volume transaction processing back ends.

We define the DB in a django model, develop the web front end with django views/ jquery and obviously get a for free admin site.

On the java side we run a hibernate reverse engineering task to generate DB access classes for the java code. Where required we use home crafted JSON over AMQP RPC mechanism to communicate between python and java components.

There are ups and downs to this approach. For us as we were not using any big java frameworks, it gave us access to quick / lightweight web front end to our solution as well as the ease of modelling our database using the Django model format (which I like a lot).

On the down side we did encounter some tricky stuff with hibernate reverse engineering configuration (which is complex if you are doing anything that is not bog-standard - especially in relation to some Django ManyToMany relations).

I notice you mention that you already have a Spring based architecture with a web tier. I'm no expert here but that may present you with opportunities worth exploring such as groovy/grails or the SpringMVC which in version 3 claims to be much simplified and faster to develop against. This may give you the wins you need.

A compromise might be to look at some RoR inspired Java tools like Rife.

Bottom line is that you will have to make the call in light of what your own application requirements and team capabilities are. It worked for us and was I think the correct decision for us but if your team is already tooled up with Java & Spring skills then Spring 3 might be the way to go (but ask a Spring expert about that :-) )

Rob

rtmie
Thanks Rob. We are using Spring 3 (with webflow and mvc). Several of us have quite a bit of Spring experience, but a couple of the developers feel that it's slow compared to RoR (which I don't have much experience with) so we're trying to evaluate our options.
Tristan