A successful story of Ruby on Rails in the enterprise



Written by Anthony Heukmes on Fri May 29 11:24:37 UTC 2009

1 comment



Robert Martin gave a excellent keynote at RailsConf 09 "What killed Smalltalk could kill Ruby too" where he enforced that Rails must open his doors to the external world's needs.
There are a lot of good practices and conventions in the Ruby and Rails community and I really think it's the best framework for web development.
But our practices are not respected everywhere. Other people have different needs/visions and Rails should be a good solution for them too.

A simple example is related to primary keys. By default, database tables of a Rails application contain an auto-incremented ID acting like a primary key.
In his base version, Rails doesn't support composite primary keys. A plugin exists to add this functionality but it's not a core feature of ActiveRecord.
If you ask Rails fanatics for the reason of a such choice, they will tell you that composite primary keys is not a good practice and you should avoid them!
Unfortunately, those primary keys are everywhere in the professional world where a lot of big Oracle schemas don't respect our conventions. And they will of course not change to adapt to a new framework.

Rails have to adapt to that kind of needs if we want it to be a competitive choice for the enterprise.
And happily, Rails is more and more enterprise ready version after version.

I recently managed to integrate Rails in a big company which was only using Java. The goal of this article is to share the difficulties I met during the process. I hope it will maybe help you to accomplish the same "exploit" and make your dream comes true : using Rails on a daily basis!

Rails development on a legacy Oracle schema was my main fear. Until that day, my schema was always evolving with my Rails application and so, it was following the ActiveRecord conventions.
However, I rapidly discovered that it was easy as pie to configure an AR model to override these conventions. You can read my blog post on this subject. Executing stored procedures and other kind of boring stuff is also a piece of cake.

The scripting language term is scary for most people, mainly because of the slowliness idea associated to it.
Do not hesitate to reassure your customers by showing them many high traffic websites using Rails and enforcing that they don't encounter performance issues. Here is a list that will help you in this task.
Another argument to bring to light is JRuby on Rails. I think it's a great solution to integrate Rails more easily in the enterprise. Customers are very happy to learn that Rails can run on the JVM and that they will not totally leave the J2EE world.

Ruby and Rails skills is another major problem. If you suggest a new Java framework, chances are big that it will be accepted very easily. All developers in the company already know Java! But almost nobody knows Ruby and that means they will loose time because of the learning curve! And don't forget that many developers are not passionate by their job, they don't want to learn new technologies! Add to this the fact that it's already difficult to hire a good Java developer... how hard will it be to find Rubyists?

I personaly got rid of these fears by demonstrating how Ruby and Rails are easy to learn. Take the necessary time to prepare an attractive training during which you will share your excitement and your passion for this technology. I gave trainings to my colleagues and they quickly discovered Rails' benefits and how easy it is to learn. Most of my co-workers were then blowing the merits of Rails and I wasn't the only one to fight anymore.
"Awesome" was on every mouthes when my colleagues started their first test applications using our wonderful framework. What a pleasure to see their smiling faces!
I also compared pieces of Java and Ruby code if front of a customer so he can realize how Ruby syntax is clear and easy. And so, how Rails applications are easier to maintain over time.

Another issue is Rails development on Windows. I'm personally working on a Mac but I'm the only one.
We tried Aptana and Netbeans but it was clearly not a good solution. Happily, RubyMine released an excellent IDE. You have to try it!
A big problem is that Windows is even used for deployment. And we all know that deploying a Rails application on Windows is a pain in the ass. Plus, tools to monitor and deploy Rails applications are considered as toys compared to the powerful Java tools. One more time, I think that JRuby can be the perfect solution. The warbler utility makes it possible to create a war file from a Rails application. Once you have that, you can easily deploy your app on any J2EE application server. I'll talk about that in a next article.

The enterprise word is very often associated with portal. So a natural question is : "Is it possible to integrate a Rails application in a portlet?". I never personally tried but I read that it's possible to achieve.

The Java framework (Oracle ADF) that had been used since now by our customer was based on JSF so users were used to rich components like datagrids with sorting, pagination, etc. The kind of stuff we don't have out of the box with Rails. That why I created a Rails plugin based on jQuery to create full featured datagrids with just a few lines of code.

Finally, I will finish this article by giving a few arguments that convinced my customers.

RSpec was very appreciated! I simulated a failing test and the autotest-growl combo made a good impression.
Specs generation at the doc format was also an interesting point.
I was not using Cucumber at that time but I'm sure that it will impress too!

I aslo created a template for new projects creation. It contains the company layout (css, images, ...) and other shared functionalities. The possibility to generate a new application with just one command line was very appreciated.

Do not hesitate to share your experiences... I'll be happy to read them!
Bookmark and Share

Add a comment



1 comment for this article



I'm about to help a client setup a Rails stack on a Windows 2003 and IIS stack. I've never dealt with either, and from the dates on the tutorials I found online, it doesn't seems like many other people have dealt with it either. I'm hoping it all goes smoothly, but I totally agree with you that it'd be great if the Rails community expanded beyond the Mac/Linux small dev shops and gained some corporate backing.


Written by Jerry Cheung on Sat May 30 09:26:56 UTC 2009