Ok, so Amazon announced that you can now use your root domain to host static sites on S3, but should you?

Well, no. Why? Well, there are a couple of reasons.

DNS

First and foremost, you have to use Route53 to host your DNS. There is no single IP you can simply assign to your root A record (which, yes, does make sense). That means some additional cost per month (depending on how much traffic you get, and therefore how many queries are executed each month). It also means that you have to change your DNS provider, which might break existing infrastructure and processes, so you’ll have to deal with that hurdle too.

Still, an extra $1.50 a month isn’t a big deal — at least not for a single site, things start to get different if you’re “parking” 100 of them.

Limitations

S3 also comes with several other architectural limitations1. First and foremost, you can only have 100 buckets in your account at any time, so don’t plan on using S3 to scale out your static website service very far.

Even if you’re only hosting a handful of sites, you have to deal with naming limitations. Bucket names are limited to 63 characters long and can only contain lowercase letters, numbers, and dashes. Unless you’re in the US Standard / Virginia region (which peculiarly allows up to 255 characters), you won’t be able to use underscores and your domain will be limited to about 60 characters.

Encoding

Most importantly for performance of your site, S3 also does not compress your content. You can, of course, serve manually-compressed content, but that’s not of much help for things like CSS and Javascript — common fixtures of static websites.

No CDN

Remember that just because you can host a static website from your S3 bucket doesn’t mean you’re using a “CDN”. S3 is notoriously slow by comparison.

That may not matter much when you’re serving up a large media file that will take 20 minutes to download anyway, but when you’re talking about half a dozen small static files (CSS, Javascript, HTML, images) that have to load before your site works it makes a huge difference.

CloudFiles

With CloudFiles you still have to use the www prefix2, but the actual hosting experience is much better.

First of all, you can use any DNS provider you want or use the free Cloud DNS Rackspace provides. You can create up to 500,000 containers, use names up to 255 bytes long (URL-encoded)3, and get automatic compression through their global CDN — all for the same base price.

  1. Per the S3 Developer Guide
  2. Using something like WWWizer makes this much easier. 
  3. Per the CloudFiles Developer Documentation
Originally published and updated .