Toronto Rails Night - Merb Presentation
Last night was yet another successful Toronto Ruby on Rails Nite put on by Corina Newby. The Toronto ruby community is rocking, evidenced by the large turnouts and fresh faces we see everytime. I’d guess 40-50 of Toronto’s best and brightest Rails developers filled out the room. The unspace guys put on some much appreciated beer and made sure we’re all informed about the upcoming RubyFringe (can’t wait, I’m really hoping Zed’s presentation is as exciting as his blog rants posts).
Along with the other presenters of the night Mike and Libin/Wes/Carsten (up on TorontoRB.ca sometime in the next day or so).
I did a presentation on Merb - The pocket rocket framework. Slides are are here (you may have to click through to the blog post to view if you’re reading this in a reader/aggregator). Resource links are at the end of this post, and some discussion notes follow..
Presentation background
Intended for people who are interested in looking at Merb, collating key points from blog posts, irc dicussions, mailing lists, and own experiences getting an app running with Merb (well the opposite way round, trying to get an app running and finding out those answers!). Hopefully the presentation collected a fair few hours worth of investigation into 20 or so minutes to help other people out
Sports Bikes vs Sports Cars
Useful analogy between Sports Bikes (Merb) and Sports Cars (Rails). Said cars have all the bells and whistles, everything is packaged up nicely, and it’s pretty hard to hurt yourself, however given the nice packaging it’s pretty hard to modify things. Sports bikes (Merb) on the other hand, are much more open to tuning, playing with, go faster, but need a bit more care
Same same but different
Rails and Merb apps are very much of the same likeness, but there are differences. Don’t expect to be able to port code over 1:1 (especially if you’ve got a big reliance on plugins), and don’t pepper the merb mailing lists/irc channel for “please make xyx behave like it is in rails
merb-core & merb-more
Two gems you need to get started (technically you only need merb-core). -Core is the stripped down bare minimum to get merb running. -more contains all the nice packaged goods to help you along the way
merb-gen is your friend
throw out script/* you’re now doing everything in merb gen for generating your app, models, resources etc
Key code differences
refer to slides, but the code used is difference
Agnostic in a very good way
Merb is agnostic when it comes to ORM, test framework, js framework, rack adapator. merb-gen behaviour changes based on component used so if you’re using rpsec, then stories get created vs unit tests. This is one of the reasons I’m very much into the idea of Merb
Cool features
part controllers, action args, router, covered off in the slides.
Full apps, flat apps, very flat apps and thin servers and large grains of salt
For performance stats (which are to be taken with a very large grain of salt). Hello world action on a single controller, rails would be about 300 req/s full merb app would be round 500 req/s flat merb app 500-550 req/s, a very flat app marginally quicker again, front a very flat app with thin (merb -I veryflatapp.rb -p 3000 -e production -a thin) and woah hold on, 1000 req/s ! Question was asked about benchmark figures and I made the point, they’re going to be all over the place - it’s easy enough to benchmark for yourself, that’s the only thing that’s really relevant. We know Merb is quick, just how quick will depend on your own application and uses.
Merb, Rails and you
The inevitable discussion at the end around, should you use Merb and how does it relate to Rails. Some of the goodness in Merb looks to be slowly being backported to Rails, so over time Rails will benefit from all of the wizardry going on in Merb (hopefully!). For those that like Merb’s approach, and willing to forsake the vast library of rails plugins, and/or have very specific performance requirements and/or need to hack a framework around to do what they want. Merb looks to be killer. Ultimately it’s upto you, so evaluate carefully.
Resources
Lots of link goodness…..
http://merbivore.com
http://wiki.merbivore.com
http://merbunity.com
http://merborials.com/
http://groups.google.com/group/merb
http://github.com/search?q=merb
http://mwrc2008.confreaks.com/
http://www.slideshare.net/search/slideshow?q=merb
http://www.slideshare.net/search/slideshow?q=datamapper


6 Comments, Comment or Ping
Mike Bowler
Thanks for the talk on Merb. The few things I’d heard about it prior to this had given me the impression that Merb was nothing at all like Rails so your talk was a real eye-opener.
Jun 11th, 2008
Fabien
Hi Rowan,
It’s nice to see you’ve been looking into Merb! Looks like an interesting presentation you gave.
I thought you might be interested in knowing that http://activeform.rubyforge.org/ has been supporting Merb for a while now. Also, recently I developed ‘merb-slices’ (part of merb-core), which offeres ‘Engines-like’ functionality but in true Merb spirit - flexible and lightweight
Cheers,
Fabien
Jun 11th, 2008
admin
@Mike glad I could help!
@Fabien, good to hear from you - I simply ran out of time to get into merb-slices (something to do with reno’ing a house!) can’t wait to try activeform out with merb…
Jun 11th, 2008
Reply to “Toronto Rails Night - Merb Presentation”