Merb: Rails Alternative Takes Modular Approach

Engine Yard has just released the community version of a new Web framework for building Ruby applications. Dubbed Merb, the open source framework written in Ruby is "super-light and super-fast," according to the company, which is positioning it as an alternative to Rails.

Rails, of course, is the framework that catapulted Ruby to the popularity it enjoys today. In fact, when developers talk about Ruby on Rails (RoR), they often simply say "Rails."

Both Merb and Rails are Model View Controller (MVC) frameworks, but where Rails is monolithic, the Merb architecture is modular. It's based on an extensible, pluggable architecture, and the code base was kept to the bare minimum.

This modularity is the key difference between the two, and the need for it among Ruby developers was the driver behind the project's creation, explained Engine Yard's Yehuda Katz, chief maintainer of the Merb project. Katz, who works full time on Merb application development, sees the framework's modularity as a missing level of flexibility that Ruby developers need as they move into the enterprise and the cloud.

"Rails is great for getting up and running with an app that other people have built before using known technologies," Katz said. "It's highly tuned for specific cases. But once you get out of that zone, you have to fight with Rails quite a bit."

Merb also provides developers working on smaller applications a way to replicate common Rails tasks with less overhead and a higher degree of customizability, he said.

The Merb architecture is object-relational mapping (ORM)-agnostic, and gives coders a wide range of choices among JavaScript libraries and template languages, Katz said. It offers flexible routing and better control over groups of processes, and additional features can be plugged into the framework using standard gems. (RubyGems is a Ruby packaging system that provides a standard format for distributing Ruby programs and libraries.)

"This isn't one giant framework here," Katz added, "so it's easy to opt out and just use the pieces you need."

Another feature of this release (Merb 1.0), Katz pointed out, is the "Merb Stack," a coherent maintained stack designed to allow developers to start building new applications immediately; there's no time wasted putting together a complete stack of their own. Also, Merb 1.0 is built on a single master process, rather than several disparate processes. That approach makes it possible for groups of Merb processes to share memory. That memory sharing capability leads to more efficient handling of multiple requests over short periods of time, Katz said, and better control over groups of Merb processes.

"Ruby continues to be one of the fastest-growing programming languages in terms of adoption," said Ezra Zygmuntowicz, founder of the Merb project and co-founder of Engine Yard, in a statement. "Merb offers Ruby programmers another choice for building Ruby applications. We believe this release of Merb and the community enthusiasm we've seen for the project since its inception are testaments to a healthy and robust Ruby ecosystem."

San Francisco-based Engine Yard is also responsible for Rubinius, an open source virtual machine for running Ruby programs and a Ruby core library.

The APIs in the Merb community edition are set, and the framework is nearly ready for prime time, with just a few kinks to be worked out, Katz said. The company expects to release the final version by the end of October.

Merb is licensed under the MIT license. "Merb started out about two years ago as a little hack," Katz said. "As a fledgling project that went a little beyond the hack, we wanted to encourage adoption. We thought this license would be better for enterprise adoption than the GPL. We didn't want people to be scared of the license"

The name "Merb" is a merging of "Mongrel" and "erb." Mongrel is an open source HTTP library and Web server for Ruby applications; erb is an implementation of the eRuby templating system. The original Merb hack was a Mongrel handler with built-in controller and view templating with erb.

A Merb 1.0 preview is now available for download here.

About the Author

John K. Waters is a freelance journalist and author based in Mountain View, CA.

Featured

  • AI robot with cybersecurity symbol on its chest

    Microsoft Adds New Agentic AI Tools to Security Copilot

    Microsoft has announced a major expansion of its AI-powered cybersecurity platform, introducing a suite of autonomous agents to help organizations counter rising threats and manage the growing complexity of cloud and AI security.

  • modern college building with circuit and brain motifs

    Anthropic Launches Claude for Education

    Anthropic has announced a version of its Claude AI assistant tailored for higher education institutions. Claude for Education "gives academic institutions secure, reliable AI access for their entire community," the company said, to enable colleges and universities to develop and implement AI-enabled approaches across teaching, learning, and administration.

  • central cloud platform connected to various AI icons—including a brain, robot, and network nodes

    Linux Foundation to Host Protocol for AI Agent Interoperability

    The Linux Foundation has announced it will host the Agent2Agent (A2A) protocol project, an open standard originally developed by Google to support secure communication and interoperability among AI agents.

  • open laptop in a college classroom with holographic AI icons like a brain and data charts rising from the screen

    4 Ways Universities Are Using Google AI Tools for Learning and Administration

    In a recent blog post, Google shared an array of education customer stories, showcasing ways institutions are using AI tools like Gemini and NotebookLM to transform both learning and administrative tasks.