Posts Tagged ‘TuboGears’

Rails, Django, Pylons, CakePHP, TuboGears, etc. Choosing the Right Web Framework.

Friday, August 17th, 2007

I’m planning on doing a web application that will have to scale immensely. It will require support for complex SQL queries (or using stored procedures in PostgreSQL), and it will have to scale.

The first framework I looked at was using Rails, which is an obvious choice. I’ve done some basic apps in it in the past, and I am very familiar with the Ruby language itself. Ruby is slow. On some benchmarks I’ve seen it 3-5x slower than Python. Also, I don’t like how it’s a struggle to make complex queries that are efficient. If there’s an easy way, it’s not well documented. I’m a little beyond the “Here’s a movie that will show you how we made a blog in 10 minutes using scaffolding.” Gems is pretty nice too, but I think I will pass on rails this time.

I found CakePHP next, but I really would like to stay away from PHP. I’d write my own lightweight framework if I were to use PHP. I’ve also heard that people have had issues with it.

After that, one of my friends suggested Django. From what I can tell, it would be great for an intranet or something like that because it can have many portals and such. It looks like the templating system is pretty solid too from what I’ve read. It hasn’t sold me. I want to try something different from rails that isn’t a full stack.

Next, my friend recommended I try TurboGears. Sure, it flaunts it’s 20 minute wiki, like Rails flaunts writing a blog in 10 minutes or whatnot. I like how it just ties existing components together. This means in the future if I need to write my own custom templating engine, or model to suit a specific need, it won’t be a huge pain to integrate it with the rest of the site. I’m kind of sold for now, but I still need to set it up. I also REALLY like how TG2.0 is converging with Pylons to make it play with WSGI nicely

After looking at TG, I was obviously lead to Pylons after reading about TG2, because it’s a web framework as well, that acts like a glue with certain Python web technologies to make an MVC framework.

While looking for the perfect framework, I keep going around in circles. I obviously can’t write my app in each one and see which one is the best. None of them are really proven. I mean, I keep consider just using PHP and smarty for templating. I really want to stay away from PHP though. I’d like to learn something new.

Also, it seems like all the reviews/comparisons on frameworks I have found are dated at least a year and subjective. I understand it’s not really possible to have an objective comparison on frameworks. At least with languages you can have benchmarks, but with frameworks it’s not always CPU cycles that wins.

I also looked at Zope, but it’s not really practical for what I am trying to accomplish.

Right now I am going to attempt TurboGears (using SQLAlchemy and Genshi). SQLAlchemy looks tempting because I read that you have more control over your queries with the “Data Mapper” paradigm versus the “Active Record” one. Genshi seems sweet too, even the author of Kid (the current default templating engine for TG) endorses Genshi. It seems like there is a lot of momentum behind it.

I will share my experiences with TurboGears or whichever framework I end up going with. Stay tuned!

Also, please feel free to correct me if any of my assumptions are wrong.