RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Move Over Rails. Here Comes Merb. : Page 5

Merb is potentially much faster than Rails, and the combination of Merb and Ruby can provide the performance most web apps require. Find out how Merb can deliver a 2-4X speed increase over Rails and why that makes it better for certain applications.

Which Apps Are Best for Merb?
Am I going to completely give up using Rails in favor of Merb? Absolutely not. I currently see Merb to be most suited for either small compute-intensive web applications or for creating web services from Ruby applications.

The techniques I discussed in this article (note that I did not cover using page and fragment caching, testing frameworks, and "slices") reflect my own use of Merb to create small, targeted web services and web applications. I believe that Merb is an especially good fit for writing web services; notice that when you create a new resource with merb-gen, the generated controller contains a commented out line that you can uncomment to enable rendering XML, YAML, and JSON:

class Feeds < Application
  # provides :xml, :yaml, :js

When you use a provides method call in your controller, you get an automated conversion of Ruby model objects to data formats, which are also useful for implementing web services.

I am still experimenting with Merb to understand which other kinds of projects are a good fit for it and which are best implemented in Rails. I encourage you to do that same.

Mark Watson is a Java consultant and the author of 14 books on Java, artificial intelligence, C++, and intelligent agents.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date