Whenever I bring up Ruby on Rails to Java programmers I always get an immediate defensive. For some reason Java programmers seem threatened by Rails. I am sure it is more to do with fanatisim that both camps have for their language. When evaluating a new endeavor however, it is wise to make an open minded decision about the framework to use.
Now there are some areas where these two languages overlap like JRuby. However, JRuby is really just Ruby compiled in Java. There are some benefits if you have some legacy Java system to integrate with, but the overhead of running on the JVM instead of the native Ruby engine really eat up some of the benefits of Ruby on Rails in the first place. The main area where JRuby has a home is in close minded organizations that won’t “allow” another operating platform to be used. Enterprising developers then develop a full blown Ruby or Ruby on Rails applicaiton and just deploy it on the Java EE platform in use by the enterprise.
There are strengths and weaknesses to both of these platforms. Evaluating these and looking at your target are essential to making a good decision. Rails is very good when you have total control over your design including database platform, table designs, graphic layouts. Rails is also a good choice for design shops that are heavy on graphic designers and light on programmers. Where Java and it’s many platforms shine is in environments where you have a legacy system that can’t be changed. It is also very good for times when you have other systems particularly SOAP or other EE systems to interface with.
With all this said I am about to enbark a new adventure. The primary platform is going to be Rails. The reasoning behind this is the lighweight deployment architecture, built in support for many web based functions, and the active community. I am already faced though with a shortcoming in the Ruby on Rails architecture. Threads. I have a data structure that is not well suited to a database it is going to be a Graph of user relationships that I need to parse out at least 3 degrees deep for many operations. The standard MySQL database doesn’t really have anything yet to support these types of complex relationships. I could implement a graph object in Ruby, however, it can’t be shared between the processes running on the application server very easily.
In comes the Java EE server. I am looking at a very light RESTfull web service to handle my relationships. I will post some additional posts and guides once I have things up and running as I am not really finding many examples where Rails ActiveResource is a consumer of a Java service.
For an update check out my revised position on jRuby: Revising my position on jRuby.