Cloud Computing

Aug 10, 2010

Last week, Amazon made a very small technical addition to the CloudFront service that has the potential of rocking the hosting world.

I haven't written anything on cloud computing yet. I'm no expert, but I do use several services, so there's no reason why I shouldn't. So far, I have the nWire update site hosted on Amazon S3 + CloudFront and the nWire Eclipse distributions hosted on Rackspace CloudFiles. Rackspace is cheaper, but not suited for hosting Eclipse update sites because it is limited to a flat file list with no support for folders. But that's not why I'm writing this post (and possibly a topic for other good posts).

Back to the main issue: Amazon just enabled having a default root object in your CloudFront distribution. Essentially, this means you can now host complete static web sites on Amazon CloudFront with no need for any proxy or web server what so ever. Up until now, you could host all your static content in CloudFront. For example, if your main page was index.html, visitors asking for http://www.example.com/index.html would get what they need. But when a visitor makes a request for http://www.example.com/ the server would simply answer which a response that looks like gibberish. Not anymore. Now, you can tell the server to direct the visitors to index.html, which means you have a web site.

CloudFront is a very cost affective and highly available combination. Such a static site will probably withstand traffic spikes better than any other solution you can think of. It is served from the CDN edge locations, so it is also very fast. The cost is really dirt cheap compared to quality hosting solutions. More importantly: you pay for what you use by the amount of data and you don't pay for CPU time.

The downsides of such an approach is that you cannot use dynamically generated pages. Many of the informative sites I visit are mostly static. Especially company web sites. The dynamic parts are the blog and the forums. One can easily create a combined solution where the blog is served by a service like Posterous and the forums are hosted by a service like Zendesk. Forms can be hosted by services like FormStack and a simple mailing list signup can be embedded using ready-made JavaScript code from MailChimp.

If you really must have dynamic content you could also consider using AJAX to load it into the static pages (JQuery makes this a no brainer, but I digress). For example, if you have badges from services like TweetMeme or Reddit, this is exactly what will happen.

Another downside is updates. CloudFront takes time to propagate updates to the edge locations. Amazon claims it may take up to 24 hours. My experience shows it will take much less, but it is not immediate. Usually it will take a few hours.

At the moment, getting started is not trivial. Setting up the root object requires some hacking (see the CloudFront documentation). The CloudFront console still doesn't support setting this property. I've been told that the next release of CyberDuck will support setting this root object, which will make the job a whole lot easier if you use a Mac. I'm sure that Windows-based tools will add support as well.