How are we going to run this thing?
Being scalable is important. Especially when you’re aiming at a large (or small!) amount of users for your new web service. Being able to add power when it is nessesary and remove power when usage is low is key for a flexible hosting and development process when building a web app.
Since our app is such an app with an uncertain future in visitors, we decided to use Amazon Web Services from the start. We at least learned this much when building and running Tweetburner
So what is the server setup?
It’s quite simple: we created a server image based on the Alestic Ubuntu images. The current Twumult image runs Ubuntu 8.04 LTS Hardy. Ubuntu is a great distribution for these apps since there are a lot of tools already available and due to the large community and Debian base practically everything you need is available as a package for you to install.
The reason we build our custom app image is so we can scale up whenever we can. It makes it possible to press a button, change some configuration files and you have a second server up and running with all software configured to run the web app. If you would use standard images for every deployment, you would have to re-install them every time you add an instance.
And your database? EC2 instance data is not permanent, right?
Right. If you terminate an EC2 instance all your data will be lost. For running a persistant MySQL database is this not what you want. That’s why Amazon introduced Elastic Block storage. See this as a USB harddrive connected to your virtual server. If the server dies, you can take the harddrive with you. You store your MySQL databases on the harddrive and can take it with you to any instance you want MySQL to run on. Furthermore, you can expand the size of the Elastic Block Storage on the fly!
What about software?
As said before, we run everything on Ubuntu LTS. Besides that, here’s the list:
- Apache 2 for being the ultimate gatemaster
- Ruby on Rails
- Phusion Passenger for serving Rails
- Capistrano for deployment
- Beanstalk for Subversion hosting (no, not on git yet)
And a lot of other small stuff like logrotate to rotate our production logs.
I hope you liked this post. Do you have feedback, comments or questions? Let us know







git contributes to the success of any project… not using git can cause tracking problems, long nights of merging, and all kinds of health problems. So use any other scm at your own risk.
@advany Luckily I use my bazaar-svn bridge
So far so good. Beanstalk is just a great service for our needs.