All it takes is a mention on Digg.com or Slashdot.org to bring your website to its knees. This has been referred to as the "Digg Effect" or the "Slashdot Effect". Anyway, in today's economy, you buy just the bandwidth you need from your hosting provider and not 1 KB more. One way to deal with this situation is to increase your bandwidth. This is an expensive solution and since most of the extra bandwidth would go unused most of the time, it's very inefficient.
A much better solution is to use the Amazon Simple Storage Service (Amazon S3) which is a pay as you go service. In the event of a traffic spike on your website, you would simply pay a little more for the extra demand. In this article, I am going to show you how you can easily migrate objects that make up your website to the Amazon S3 environment. In addition to your website being stable during periods of high demand, overall performance on your website will improve.
To illustrate this concept, let's first look at the make-up of a typical web page. Using Pingdom, a popular web page performance and benchmark tool (http://www.pingdom.com), I opened a random page from a popular hardware website. This pie chart shows the breakdown by file type according to Pingdom tool. This is the business case for a content delivery network. Most of the bandwidth is taken up with images and script files. Off loading these from your website to Amazon would increase performance and keep your website from going down during a traffic spike.
As you can see, 415.8 KBs or 51% of the total downloaded by the browser are images and 212.5 KBs or 26% are scripts for a total of 77%. If we were to move these images and scripts to the Amazon S3 environment, we would not only increase overall performance but we would be in a much better position to handle traffic spikes. At the end of the day, bandwidth from your hosting provider would only be responsible for 23% of the total page (in KBs). This could really stretch the bandwidth from your hosting provider.
Are you sold? OK - on to how it's done.