How I picked a stack for our startup

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.

Final rundown:

  • Python + Pyramid
  • SQLAlchemy + Redis
  • Backbone.js
  • mustache + hogan.js
  • Amazon EC2 instance(s) running Ubuntu server

I can live with that.

9 thoughts on “How I picked a stack for our startup

    1. I certainly hope not! Symfony2 has a soft spot in my heart for being the framework that I really learned to develop on. However, since I won’t be working with it as much and I can’t just write a post saying, “hey guys, check out what I’m doing today,” if you have any topics you’d like to read about, please let me know!

  1. Definitely sounds like a solid choice. Since you have all that Symfony background, would be interesting to have your “aha” moments, when you discover that something in Pyramid is simply done “so much better” than we do in Symfony.

    SQLAlchemy so I guess you’re gonna be relying on a relational database. Did you check about other possible databases?

    Also a reason on EC2 vs other cloud providers? I’ve tried to love EC2 but just couldn’t bring myself to it. They’ve made things over complicated by using lots of weird marketing lingo instead of just saying “This is a VM!”. Also the VMs I could play with on the free tier were non standard linux distros so doing everything with em was just a pain. I’m using Rackspace as it gives me a familiar environment immediately. A VM is a VM, not an AMI. A cloud storage server is a cloud storage server with files on it. Not a cluster of buckets and so on! ;)

        1. Ha, fair enough! I’ve been drafting a follow-up post to this, but here are some of the main points:

          The other option I considered was MongoDB. I went with MySQL for the simple reason that I’ve never had a problem using an RDBMS before. I expect the MySQL database to get a lot of reads and (relatively) few writes, and most of the data that has a high change velocity (stats, notifications, etc) to be stored in Redis. I hope one day we hit the problem of needing to scale beyond MySQL’s capabilities, but at that point, we’ll have more resources that we can throw at the problem :)
          I honestly got started using Amazon EC2 because it was cheaper. Then they introduced the free tier, and it got even cheaper. I agree that the default image is less than ideal to work with, but I’ve been running an Ubuntu Server image for a while now without any problems.

          Another thing to consider… I picked Pyramid because I didn’t like Django’s ORM. I’m reconsidering that choice, because the time it would take to wire a bunch of 3rd-party libraries together (like some kind of form handler, for instance, or an authentication system) isn’t worth it to me. Those are all things that I took for granted with Symfony2 and Django.

  2. Ok, I’m seriously considering MongoDB cause I’ve tried it on some simple projects and love the simplicity it gives.
    Also when I tested Amazon first, there was no available Ubuntu AMI on the free tier. Only the custom Amazon one which didn’t have much documentation about it, didn’t seem to have a package manager etc …

    Amazon seems to be starting at prices similar to Rackspace but gets cheaper when things grow. However this is a bit unfair comparison because for this price Amazon gives you ZERO customer service. For nothing more Rackspace gives you incredible customer service.

    What I still don’t like and understand about Amazon:
    Seems super complex to just add domain name routing so that http://domain.com goes to my AMI.
    No out of the box simple and automated way to do backups.

    I still think we’ll go with Amazon’s free tier in the dev phase, giving us more time go get a feel of it and not pay any money. I was on Rackspace for other projects and just LOVE how they make things simple for me.

    1. You might want to take a look at Ylastic, they’re a sort of ‘managment app’ for AWS. They’re very cheap (25$ per month), and I use them for pretty much everything on AWS. They make Route53 (DNS) very simple, you can easily schedule tasks to backup EBS and RDS to S3, etc.

      I also use the Ubuntu 10.04 AMI btw and never had any complaints.

      Hope this helps!


Leave a Reply