So, I’ve been doing a lot of thinking and research about the right stack for building a web app. I think I’ve finally come to a conclusion, and I figured I’d share it with all y’all.
First, language of choice. I’ve been involved with PHP for years, so that seemed like an obvious choice except for one thing: I really want to get out of PHP. It’s just lost my interest as a language. I’ve no interest in a verbose, restrictive language for writing a web app, so that rules out Java (I can hear the Java web crowd getting up in arms; you can both leave now). And it has to have solid, well-supported web framework options. The two languages I’ve been toying with recently are Python and Ruby, but I just can’t bring myself to love Ruby on Rails. So, Python.
That one was actually a tough choice. I like how simple and fluent Python is, but I love how expressive Ruby feels. In the end, I had to make a gut check, and I felt like Python would be a better business decision.
Next, framework of choice. I was originally gonna go with Django, I don’t really like the way that it “feels.” It’s hard to describe, but part of it is that I don’t really like Django’s ORM: the Active Record pattern (and approximations of it) has never been very appealing to me. So anyway, I was mulling it over, and I came to the conclusion that a monolithic one-stop framework might not be the best choice. Using something a bit more lightweight that would us swap in components and go for best-of-breed functionality would be more practical. Maybe Pyramid + SQLAlchemy + Jinja2 (since I do love me some Twig), using Redis for ephemeral stuff that can be reconstructed from the on-disk database if necessary.
But then, what about the front end? I’ve been meaning to build a production app with Backbone.js, and using Backbone.sync, the onus is completely on the front end to render content. So scratch Jinja2, use mustache instead, with hogan.js to compile the templates. The Pyramid/SQLAlchemy/Redis trio becomes an API only, decoupling the front end from the back end and allowing us to easily port the web app to anything else that we can imagine: mobile web, iPhone/Android app, whatever.
For deployment, I’ve become a big fan of Amazon’s EC2: cheap and easy. I’m not particularly a fan of CentOS though… Ubuntu is more my speed. So, EC2 instances running an Ubuntu 11.10 server AMI from alestic.com will serve as the deployment bed.
- Python + Pyramid
- SQLAlchemy + Redis
- mustache + hogan.js
- Amazon EC2 instance(s) running Ubuntu server
I can live with that.