Lightweight Ruby Frameworks

I have a small CRUD-based web application to put together. I'd like to start it off with a simple lightweight Ruby framework, then maybe graduate it to a full-fledged Rails app. I've found Camping and Merb.

I like Camping just from the description:

Camping is a small web framework, less than 4k, a little white blood cell in the vein of Rails.


Descriptive and subtle.

Both frameworks look interesting and both support ActiveRecord. What's the consensus on which one to go with at this point? My goal is not necessarily to be bleeding edge (unless it buys me something amazing), but to have something that is simple and just works. It would be nice to have easy-to-use ajax support as well. If there's another framework that I haven't found yet, I'm open to that too.

Also, which web server would be the best match for the situation? The comments from the last Rails post said Mongrel is a good solution for Rails.

Danke.
Design Element
Lightweight Ruby Frameworks
Posted Dec 10, 2006 — 11 comments below




 

Ryan Raaum — Dec 10, 06 2617

I would just use rails from the start if you think there's any chance you will end up there. Rails is simple and lightweight. Simple CRUD is the sweet spot for rails development.

I've done some camping (merb is very new so I've done nothing more than read the release notes). And camping is awesome - but not necessarily easier than rails. Smaller for sure, but not easier. Also definitely much less well documented. _why wasn't primarily shooting for easy when he created camping - he was trying to make the smallest possible framework using all of the crazy and obscure ruby tricks at his disposal.

Jon Crosby — Dec 10, 06 2618

I can't personally speak for or against using Camping or Merb, but would second Ryan's nudge to consider just starting with rails if you are still open to it. The latest version, 1.2 (rc1 at the moment), goes beyond CRUD-based model objects with ActiveRecord and moves to first class CRUD controller support via REST.

Scott Stevenson — Dec 10, 06 2619 Scotty the Leopard

What's the place to get info on REST conventions in Rails? I tried googling a few weeks ago but didn't quite find something short and sweet.

MikeInAZ — Dec 10, 06 2621

Some of these sites on REST were helpful to me:

http://www.ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-it

http://nubyonrails.com/articles/2006/10/09/peepcode-rest-basics

http://scottraymond.net/

http://podcast.sdruby.com/2006/10/3/episode-009-rest-with-rails

http://www.loudthinking.com/arc/000593.html

Alex Payne — Dec 10, 06 2622

I'll third the recommendation to just dive into Rails.

Camping, like many of _why's toys, is an immensely clever but not necessarily practical exercise is pushing Ruby to its linguistic limits. Merb (soon to be renamed, says the author) was written largely as a high-performance alternative for demanding tasks that Rails would choke on, like uploading and resizing big images.

I'm fully aware that both have matured to the point that people are developing full-fledged sites in them, but I can't see the benefit of "sketching" a web application against one framework's conventions and then learning another when you're ready for more advanced features.

I've developed a very large Rails codebase using the RESTful conventions and I can't recommend them enough. It's nice to have best practices for the sort of features you'll be implementing the most.

Chris Ryland — Dec 10, 06 2623

Gotta try Django.

Daniel Lyons — Dec 10, 06 2624

Scott,

Firstly, to refute Mr. Ryland, if you are going to use a Python framework you're much better off with Pylons and SQLAlchemy (which is by far the best library in existence for Python). Django, apart from Guido's blessing, is an unremarkable framework when compared to Pylons, CherryPy or TurboGears.

I don't see any harm in trying out a small framework and then trying another one. Just do it out of a desire to experiment, not out of fear of Rails. Rails isn't hard enough to warrant starting with something simpler.

I would definitely recommend Mongrel for all your Rails serving. It's fast and secure and doesn't add much overhead. If it starts to suck you can always upgrade to LigHTTPd or Apache+FastCGI.

I would give ErlyWeb a try if you want to give something really different and high-performance a shot.

Mr eel — Dec 10, 06 2625

Out of the two (Merb and Camping) I like Camping the most. They're both quite light weight, but camping is even more so. For really simple stuff it's the go.

Merb hits that sweet spot between Camping and Rails. It's more full-featured than Camping, but without the overhead of Rails. For example is has some nice methods like respond_to for dealing with Ajax calls which Camping lacks (although it could be added easily enough).

Also, I wouldn't recommend moving to a Rails app straight away if you just want start prototyping. I've used Camping for prototypes that I've later moved to Rails and it's really not much work.

Go for Camping I reckon!

Scott Stevenson — Dec 10, 06 2626 Scotty the Leopard

Gotta try Django

Django is a great piece of work, but I really like Ruby for web apps. I also feel more at home in the Rails environment as a whole.

Scott Stevenson — Dec 10, 06 2627 Scotty the Leopard

@Daniel Lyons: Just do it out of a desire to experiment, not out of fear of Rails. Rails isn't hard enough to warrant starting with something simpler

It's not about being hard. I just didn't want a complex hierarchy of folders and files at this point. I'm now leaning towards just going straight to Rails anyway based on what I've read here.

Aur — Dec 27, 06 2905

Well, camping would be the way to go.

Camping makes it very easy to create one-file apps which are fully portable, and that rocks for prototyping.

The only thing I do not like about Rails is that I have tons of files and need to navigate between them all.

Camping really let me write a whole site in a single four-printed-page .rb file that had everything within.




 

Comments Temporarily Disabled

I had to temporarily disable comments due to spam. I'll re-enable them soon.





Copyright © Scott Stevenson 2004-2015