What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Dec 13, 2007 by townxelliot
WhyRails  
Why choose Rails as the platform for Jangle?

Ruby on Rails is an agile framework for web development. Find out more about it at the Rails homepage.

There are some good reasons for choosing Rails for Jangle, at least for early iterations:

Why not Rails?

There are also good reasons not to use Rails:


Comment by danmux, Nov 16, 2007

So the library support is good enough for JRuby for rest orm etc?

Comment by townxelliot, Nov 19, 2007

Yes - the whole of Rails is accessible under JRuby, including an ORM layer (ActiveRecord?) and a framework for REST; plus, if that's not good enough for you, you can call out to Java libraries like Hibernate

Comment by danmux, Nov 24, 2007

How real are the long term performance worries about Rails? Are a lot of the problems caused by bad practice a. la. Java strings 4 years ago? How much is caused by Ruby being a relative newcomer, there appears to be a high output of GC patches for example.

Wouldnt it be usefull to get to do a load test comparison before we get too far commited?

Comment by townxelliot, Nov 26, 2007

I think there are performance issues, still. But there is a fair amount you can do in terms of the app. server, load balancing, db clustering, caching etc. (see Twitter, for example). And the latest JRuby is much, much better than the last version.

I also think we should bear in mind that this isn't necessarily the last time we talk about appropriate development environments. At the moment, we want something which works, fast; and something nice for developers to work with. Whether it scales to millions of requests is a separate issue, in some respects. Also, there is always the option to hand off heavy-duty stuff to a Java service layer: I have prototyped this, with Jangle (in Rails) talking to a TalisSOA layer (in Java). In this instance, Jangle is just a thin layer over the Java services, effectively replacing the TalisSOA servlet.

Comment by andy.latham, Dec 21, 2007

What is the advantage of having Rails as the front end web service over the Java front end? The REST services can be defined in XML configuration, requiring no understanding of Java. Furthermore modules could be developed in the language/script of choice and called by a generic scripting engine in Java 6.

In other words why have JRuby call Java when we can have Java call multiple scripting lanugages of the developers choice, including JRuby?

Comment by townxelliot, Dec 21, 2007

Good points. I suppose our choice was motivated by several main factors: wanting something we could work with quickly, wanting to use something we are familiar with and comfortable with, and wanting to use something attractive to casual developers.

Rails gives you lots of good stuff for nothing: for example, helpers for HTML generation, easy ORM which requires little configuration, REST for free, built-in test framework, plugin architecture. Also you can still use the Java scripting language integration if you want (JRuby calls Java calls other language): convoluted but feasible. On the down side, Rails is less flexible than a custom Java architecture (though Ruby itself is at least as flexible).

We thought it would be easier to try out ideas using Rails than it would with Java. For example, over the last four weeks, we've done the following:

- Tied TalisSOA Java classes into Jangle. - Added an HTML forms front-end to TalisSOA (similar to the Talis Platform HTML interface). - Provided a means of having multiple REST interfaces served and managed from the same container. - Created a tiny ILS (the Jangle demonstrator) with a means of importing data into it. - Created HTML and REST front-ends for borrower data in Koha (an open source ILS), for reads and writes. - Provided read-only borrower data from both the Jangle demonstrator and Koha in XML, HTML, RDF and NCIP response formats.

Many of these things are experimental, but we felt we needed to do them to be able to understand the functionality which might be required from this kind of architecture, and to get discussions like this started. I don't know whether I could have bolted these things onto TalisSOA as quickly, without some major architectural work.

I think we should also bear in mind Frederic Brooks' point (I think it was him): "Plan to throw one away". It might be that Rails is the wrong platform for Jangle. But it enables us to throw ideas around and implement them far more quickly than we could in Java.

While TalisSOA has an excellent architecture and works brilliantly for Talis use cases, my personal feeling was that by the time we'd reworked it to make it generic enough for Jangle use cases, we could have written something else from scratch. Which I think we have, while still retaining access to TalisSOA. Though I still have reservations about Rails: I think Ruby is right, but Rails gets in the way a bit too much sometimes.

Comment by danmux, Dec 21, 2007

I think the Brooks commment is pertinent. if it turns out that rails is the wrong piece, we change it.

The hard bit is agreeing international domain models, and coding adapters - anything that helps those things happen more easily or quickly is worth doing.


Sign in to add a comment