Last tuesday I attended the “RubyEnRails2008 dag”, which is the Dutch RubyAndRails conference. It was the third time this conference was organized and this year it was located at the Hoge school in Amsterdam. The line up was really impressive. A number of the Ruby Rockstars gave presentations and at the end of the day David Heinemeier Hansson joined from Chicago for a Q&A session

EaRing

The day started with a talk from Zed A. Shaw. He is the creator of Mongrel and became really famous with his rant against the Rails community. His presentation was very entertaining but not so much about Ruby than about how great a programmer he is (which he is btw.). The project he presented was the Meta-Literal Machine which makes learning ASM fun… It was written in 2 weeks and has support for some great features like: fully dynamic functions, access to .so files, dynamic constants(!) and it has even better error messages than Ruby interpreters. He used a Fibonacci number calculation program to show how fast the Meta-Literal Machine was. Calculating 96 Fibonacci numbers 5.000.000 times took on his laptop about 1.2 sec. There was some ranting against the idea to scale up application speed by parallelization. The arguments he used were quite solid and based on an extensive analysis with Amdahl’s law. So, to make programs run faster, don’t bet on parallelization but write faster programs…

The worst Rails code you’ve ever seen

This talk, by Obie Fernandez, was about bad coding practices in Rails projects. Obie Fernandez is a well known figure in the Ruby community and is the author of the book ‘The Rails Way’. In his talk he explained that worst (from the talk title) doesn’t mean stupid, but means programming a Rails application not in the Rails way. He gave some pointers on how to code the Rails way. One of the most important things to do is to learn Ruby. An other excellent advice he gave was that it is very useful to pair program with more experienced programmers. And never forget good OO principles when writing Rails code.

Phusion Passenger™ (aka mod_rails)

A better way of deploying Rails applications on apache was presented by Ninh Bui & Hongli Lai. The apache module for running Rails apps was very outdated, not any more! The guys from Phusion created a great product for deploying Rails apps on Apache using Phusion Passenger and their Ruby Enterprise Edition. They announced version 2 of Passenger which includes many improvements like: fair load balancing (as opposite to a round robin strategy), parallel file upload (freeing up the Rails instance to handle new incoming requests) and a big reduction of the VM size. The architecture allows for running not only Rails, but also Merb, Camping, … and even Django apps using there Rack and WSGI support. The benchmarks they presented were very impressive. Comparing different deployment strategies (not JRuby on Glassfish), the Apache plus Passenger setup wins hands down with respect to speed and memory consumption. I would have liked to see a deployment setup with JRuby on Glassfish in the benchmark though.

JRuby

A talk not to miss was given by Charles Olivier Nutter about running Ruby on the Java VM. The JRuby project is production ready for some time now, and on average apps run even faster on the JVM than when running on the standard Ruby Interpreter (MSI). He mentioned that Java for some people was surrounded with negativity due to emotional arguments (I don’t like the languages) and sometimes the arrogant attitude of the Java vendors (“the answer is Java. What was the question?”). He continued by praising the JVM and showed some really impressive demos of ruby programs running on the JVM and leveraging the very rich collection of Java libraries (e.g. processing.org/ and www.the-shoebox.org/apps/44).

He then continued on showing how to run Rails apps on the JVM. The ease of deployment is really impressive. One can use any Java app server to run a Rails app as a WAR file build with the Warbler tool. Besides that, there is even an easier way provided by the guys from Glassfish using the Glassfish gem:

> gem install glassfish

> cd $your_rails_project_dir

> glassfish_rails

And its done!

A number of companies already use JRuby in there production environment: Oracle, Sun, Thoughtworks (Mingle), …

Q&A with David Heinemeier Hansson

David Heinemeier Hansson is the creator of Ruby on Rails. There was a live video connection with him in Chicago giving us the possibility to ask questions. A lot of the questions were more about the business side of 37signals (his company) than actually on Rails and its future, but it was kinda nice to see him “live” 🙂 I give you some random notes I wrote up during this Q&A:

Rails is not equal to mainstream. The mainstream should bend to Rails.

No 5 year plan: Goal numbers are bull…

Flame wars are not leading to much 😉

Localization should not be part of Rails (everybody has its own idea about what localization means)

37signals has 10TB of data on Amazon S3

Scalability?

the twitter rant is very loud, lots of noise

twitter might not be a good fit for rails (not really a traditional web app)

Yellow Pages performs very well on Rails

In the end a very fun and inspiring day at RubyEnRails 2008!