This is the follow-up to my previous post, Creating a webapp is so much easier these days!, focusing now on infrastructures to host web applications. Our website, like billions of others, is divided in two. First, the visitor section, intended to present the service and content that is relevant to our users’ interests (in the form of a blog for instance). That’s where people consume content. Second, the client section, where the webapp is. That’s where people do stuff.
Because the purposes are different, and in one instance your users may have paid to access the service, you may want to have pages served from different platforms. There might be more traffic on your visitor site, and heavier content to be served (multimedia). If you’d be hosting the site yourself, you’d run into technical problems as your infrastructure would have to cope with the increasing traffic load, and into money problems as you’d be consuming more resources (servers, bandwidth). Squarespace is a host for your website that automatically scales and charges a fixed amount per month. Plus, it has loads of nice features to help you actually build your site. In the end, all you have to worry about is your content and presentation (the themes they provide can help), since all the hosting is managed for you. If you still prefer to have control and to self-host, at least you could host your media files on a Content Delivery Network.
Hosting in the cloud
For hosting your webapp, you can go with Cloud servers like Amazon EC2. It’s great for scaling as you can commission new servers as needed, in just a few minutes. There’s more: Platforms as a Service (PaaS) such as Scalr. Think of it as a layer on top of cloud computing. Workers/instances are automatically created or removed as your traffic changes. If your app is stateless (no information about the user is stored on the server, all is either stored as cookies or in a database), you can thus scale the execution of your controllers and business logic seamlessly. Scalr also scales your MySQL database automatically by provisioning database slaves, masters, and configuring data replication. It even backs up the whole of your infrastructure automatically.
Your app, nothing but your app…
“No IT person costs, just a $99/month subscription” they say. But still, getting started with Scalr is quite a technical challenge. Although it does automatically set up a LAMP infrastructure for you, you still have to manually connect to your cloud infrastructure account (like EC2), create a server farm, a load balancer, set up DNS, Apache virtual hosts, install your webapp server (Tomcat for instance, if you do Java), and upload your webapp container. Why not just deploy the container for my app and let the cloud host figure out everything else? That would truly exemplify the Convention over Configuration principle!
Well, it’s been around for some time in the Ruby world, and they call it Heroku. All you need to deploy your RoR app with Heroku is a Git push! There’s something similar for Java peeps in the form of Playapps, recently out of private beta. Another advantage of such deployment environments is not having to worry (too much) about security, upgrades, etc.: some of the work is done for you.
Q: I still need a place to host the team’s code, no?
A: Check out GitHub, a source code hosting platform based on Git (a very fast versioning system that supposedly makes more sense than CVS or SVN), and this client for mac.
Q: How do I monitor my webapp, without infrastructure?
A: Cloud hosts usually provide some performance metrics. For app-specific metrics, have a look at New Relic.