(415) 704-1817

Rails and Merb are MVC web application frameworks written in and for Ruby. Both the framework is similar in terms of their directory structures and concepts.

Now, We have to compare Rails and Merb. and findout which one is best?

  1. Rails is not Modular based. As Merb is Modular.

  2. Rails is focused on rapid development for the web programmer. Merb is focused on speed and extensibility.

  3. In terms of speed comparison merb is faster than rails. because Merb intentionally is lighter than Rails. Faster means that processing time is spent less inside framework code and more inside the custom code. Merb also uses a faster Ruby re-implementation Erubis over the original and slower ERB.

  4. In terms of stability Rails latest version 2.2.2 is very stable and Merb version 1.0. Most of production server uses Rails compare to merb.

  5. Rails opinionated in Javascript library, ORM, and template language. Where Merb Javascript library, ORM and template language agnostic.

  6. Merb is use Datamapper where Rails more prefer ActiveRecord for database interaction.

  7. There are syntax and file structure difference in Rails and Merb.

    a. Create new application ‘test_app’
    Rails: rails test_app
    Merb: merb-gen app test_app

    b. Start server
    Rails: script/server
    Merb: merb

    c. Interactive console
    Rails: script/console
    Merb: merb -i

    d. Generate scaffold
    Rails: script/generate
    Merb: merb-gen

    e. Server configuration
    Rails: config/environment.rb
    Merb: config/merb.yml

    f. Initialization code
    Rails: config/environment.rb and config/initializers/*
    Merb: config/init.rb

    g. Dependencies
    Rails: config/environment.rb
    Merb: config/dependencies.rb

    h. Response format
    Rails: respond_to
    Merb: provides :xml, :js, :yaml

    i. Notice format
    Rails: flash[:notice]
    Merb: message[:notice]

    j. Observer
    Rails: before_filter
    Merb: before

    k. Set Routes
    Rails: config/routes.rb
    Merb: config/router.rb

    l. Migrations
    Rails: db/migrate
    Merb: schema/migrations

    M. Testing
    Rails: test Merb: spec & test

    So, Based on application requirement you are able to choose which framework is more preferable. Now It’s your time to make decide..

    Great News, that Now Merb gets merged into Rails 3!

Sorry, comments are closed for this article.