http://shellshadow.com switched from rails to merb earlier this year and I couldn't be happier with this decision.
http://shellshadow.com switched from rails to merb earlier this year and I couldn't be happier with this decision.
I've invested a fair amount of time in Rails, am happy with it. I'm not sure I'd jump for something that's "a bit better".
I've learnt to use and love Rails and it has a massive community spanning many years, so I'm not going to jump ship because others said its cool...
Thats not to say I'm ignorant to new methods of doing things, if something is better I want to try it - but why is merb better? If you compare rails 2.2 (thinking ahead) with merb, what can I do better, faster and safer which will be worth the time I put in to learn the quirks of the framework?
Merb also does not lock you in to a specific way of doing things. It's very easy to bend the framework to your will.
Rails is great for the 80/20 rule. Rails will take you the first 80% faster then any other framework. But rails will make it super difficult to get that last 20% and will cost you double the hosting fees(over merb) or more when you have to scale.
I was not happy with Rails for the work I needed to do http://shellshadow.com. I have a very deep background in App Framework development. I wrote the worlds first full-stack app framework in Smalltalk in the early 90s. I also wrote may have been the world's first ORM (also in Smalltalk in 1988). I also wrote similar full stack App Frameworks in Java. I'm out of the framework business now but have a more critical eye than most when it comes to analyzing frameworks.
I have not put together a comprehensive list of why merb is better for me than rails. You will either have to do this for yourself or wait until someone bothers to spend the time to publish compelling and objective analysis. This will come with time, I'm sure.
But if you are happy with Rails, do nothing...keep chugging along. I won't disrespect you for it. Rails just wasn't for me.
I only partially mean it that way ;). What I mean is I do feel qualified to analyze and make this decision myself without requiring others to publish analysis. I did my internal analysis and I chose merb for recoding http://shellshadow.com and 9 months later am still happy with the choice.
I don't mean to sound snob-ish about it though. Everyone has their own unique strengths they bring to working on start-ups. My experience with frameworks is one of mine.
Merb needs to spell out why I should give it a try; what makes it not just a bit nicer than Rails, but way better. If it's just not that much of an improvement, the network effects of having tons of users, plugins, etc... make Rails more attractive.
One of key benefits of merb over the many other lightweight and more modular ruby frameworks is it has the necessary critical developer mass and funding behind it from Engine Yard http://engineyard.com
There will be a Ramaze talk at the upcoming RubyConf in Orlando; hopefully it will attract more people to give it a whirl.
require 'rubygems'
require 'ramaze'
require 'sequel'
# Models
module AppOne
DB = Sequel.sqlite('app_one.db')
class Post < Sequel::Model(DB[:posts])
set_schema do
primary_key :id
varchar :title
text :body
end
end
end
module AppTwo
DB = Sequel.sqlite('app_two.db')
class Post < Sequel::Model(DB[:posts])
set_schema do
primary_key :id
varchar :title
text :body
end
end
end
AppOne::Post.create_table!
AppTwo::Post.create_table!
AppOne::Post.create(:title => "app one title", :body => "app one body")
AppTwo::Post.create(:title => "app two title", :body => "app two body")
# Controllers
module AppOne
class MainController < Ramaze::Controller
map "/app_one"
def index
@post = Post[1]
"#{@post.title}<br/>#{@post.body}"
end
end
end
module AppTwo
class MainController < Ramaze::Controller
map "/app_two"
def index
@post = Post[1]
"#{@post.title}<br/>#{@post.body}"
end
end
end
Ramaze.start :adapter => :mongrel
Run, go to /app_one and /app_two respectively. Enjoy.Here's some of what ramaze is missing:
* Some conventions (simple modules, no "plugins" please) and a space (website) to share code, such as rake tasks for sequel migrations, authentication boilerplate, etc. Ramaze needs an ecosystem of modules to allow developers to benefit from each other. I'm not a fan of cargo-culting, but rails/merb plugins do speed up development.
* Marketing/evangelism. (I'm trying).
* A more nicely integrated restful router with urls a la rails/merb conventions. While "technically" somewhat silly, all the cool kids want something like it.
For http://shellshadow.com I had to make careful decisions about being able to eventually hire others to do the web app dev, which meant making sure my framework picks wouldn't be too obscure. I had to get away from Rails. In fact, if other frameworks like Merb, Ramaze, datamapper, and Sequel didn't show up, I would have had to dump ruby.
I like Sequel http://sequel.rubyforge.org/ quite a lot. It blazes new territory for an ORM. It was a tough call to go with datamapper.
In short, Merb showed promise and I bet on the strength of its backers in addition to what I saw as solid software engineering.
It's a tough sell in the mainstream Ruby (ie. Rails-centric) community. For example, at MtWest RubyConf two years ago, Chad Fowler told the assembled crowd that people working on Nitro (arguably the forerunner of Ramaze, and an influence on other Ruby Web tools) to stop. Flat out stop working on it. "We don't need it; it's just like Rails." Which, of course, was simply untrue. (My take was that Nitro was to Rails as Ruby is to Python. Similar, but with enough differences to matter. Ramaze follows in that way. Ramaze is opinionated software that says your opinion matters )
Fortunately, people kept on with developing new Web frameworks (both Rails-like and not), but none have had the same level of hype and business backing as Rails. Merb gets some decent attention, perhaps because it's (sort of) Rails-lite or Rails-done-better. (I'm not trying to disparage Merb, just offer an idea on why it gets more traction than, say, Ramaze.)
Seeing almost every 3rd-generation Ruby Web framework use Rack is encouraging, as is the continued lack of coupling to any particular ORM, and I expect to see even more loosely-coupled, easily assembled Web tools to come along.
Good times.
I would love to use Ramaze on future projects but unfortunately it's documentation needs work.
[EDIT] I love how Sequal was designed to allow the developer to craft their data with a high degree of granularity compared to most ORM's that try to do too much magic behind the scenes.
I would love to use Ramaze on future projects but unfortunately it's documentation needs work."
Ramaze does not have an ORM. While I see a trend towards using Sequel, it is not part of Ramaze, is not shipped with Ramaze, and so you will not find much docs about it on the Ramaze site.