Let’s talk about the elephant in the room: Rails is great and is exactly what’s needed for large-scale production applications. It has history—and if you got started in Ruby working on the web, chances are Rails is what you’re most familiar with. All these things are a fair argument for Rails as the framework of choice for many projects.
We’re not here to derail our beloved Rails. Instead, the main goal of this article is to shed some light on alternatives that you may or may not be aware of. Some will focus on small-scale projects, others fast prototyping—but all of them work with Ruby.
Hopefully you will have fun exploring the frameworks and micro-frameworks that help bring this great language to the web.
Cuba is one of the easiest micro-frameworks currently available to Rubyists. Written by Michel Martens, the key to Cuba is simplicity. With the avoidance of large-scale overhead, this micro-framework is designed to build and deploy simple apps while avoiding unnecessary functionality.
Like many micro-frameworks, Cuba is Rack based. Rack minimizes the interaction between the webserver supporting Ruby and the framework itself. This helps improve app response times and makes using the framework fairly simple.
Technically not a framework, Trailblazer comes courtesy of long-time Ruby punk rocker, Nick Sutterer. The idea behind it is to help Rails work more efficiently as a framework by enforcing encapsulation and adopting a more intuitive code structure. Trailerblazer offers additional layers of abstraction to make Rails easier to work with.
Since it’s not an actual framework, we won’t go into too many details, but we will say that Trailblazer makes projects easier to use when Rails is the framework of choice. It’s easy to implement and there’s even a book that walks developers through a realistic development of a Rails application with Trailblazer.
One inconvenience for Volt at the moment is that it only supports MongoDB. While MongoDB is a great database solution, it’s not always what you want to use.
Built on the ancient coding ideal of KISS (Keep It Simple, Stupid), Ramaze is a framework that looks to do just that: remove complexity in favor of making things easier. If MRI is not your favorite flavor of Ruby, perhaps Ramaze could be your framework of choice. Ramaze is built to work with various ORMs, adapters like Unicorn and Passenger, as well as various implementations of Ruby such as JRuby and Rubinius.
Ramaze is fast and flexible, which puts it at an advantage over some of the other frameworks mentioned above. The other benefit is how it functions like other frameworks. For example, if you are familiar with Sinatra, chances are Ramaze will not be that hard to understand.
We’ve reviewed our feelings on Sinatra vs. Rails before—even more than once. It’s easy to say Sinatra is our framework of choice for most small projects. Since we’ve covered the many uses of Sinatra, we’ll give a quick summary—and encourage you to read the aforementioned blogs. Sinatra is easy to setup and there are more than a few Sinatra apps running in production on Engine Yard.
After reviewing these options, you may still be looking for something Rails-like and familiar, but not Rails. Enter Hanami (formerly known as Lotus), a complete erb framework for Ruby built by Luca Guidi. The key difference between Rails and Hanami is the latter’s lightweight speed, which should attract those frustrated with the bulkiness of the former.
Hanami is a full MVC framework and acts as such—so switching isn’t a big jump. The framework is simple and productive; developers can download, develop, and deploy, in five minutes.
We’ve reviewed just a handful of the frameworks rubyists can use outside of Rails. Again, this isn’t a call to abandon Rails. We do think, however, it’s good to expand your horizons and try out new things. And when you’re ready to get one of these things running in production, our support team is happy to help.
P.S. Have you tried one of these frameworks before? Have we missed your favorite framework? Leave us a comment below.