tags:

views:

1680

answers:

14
+11  Q: 

Amazon S3: when/why

So, I have a dedicated server. I host about dozen or so small sites.

Is there a real benefit in using S3(or Mosso) for my image and static file hosting? My server has more than enough disk space, or am I completely missing the point of S3?

I keep reading about how wonderful and cheap it is, and I ask myself "self, why aren't you using this" and the reply is always "why?"

A: 

From what I hear, besides low cost, the main advantage is the ease of backup from an EC2 setup.

Link.. http://groups.drupal.org/node/2383

madcolor
+1  A: 

If you're hosting a high-traffic site, the bandwidth cost (and latency issues) of hosting images yourself makes S3 and other services like Akami attractive. For a low-traffic site, it probably isn't an issue.

Jason
A: 

Speed might be the only benefit. If your dedicated server is simply networked through your ISP (which may well throttle upstream speeds even if downstream speeds are high) then you might find that your sites are often slow to load. If so, then S3 or another dedicated server provider can help. Other than that, I can think of absolutely no reason why Amazon's service would be more appropriate for you - especially with simple, static sites.

Mark Brittingham
+20  A: 

Hi Ronn, if you're running within the included storage and bandwidth of your server and your needs are being served well, you are already doing the simplest thing that is working for you and that is where you should always start. Off the top of my head I can think of a couple reasons why you may want to move some storage to S3 in the future:

  • Your storage or bandwidth needs grow beyond what you have and S3 is cheaper than upgrading your current solution
  • You move to a multiple-dedicated-server solution for failover/performance reasons and want to be able to store your assets in a single shared location
  • Your bandwidth needs are highly variable (so you can avoid a monthly fee when you're not getting traffic) [Thanks Jim, from the comments]
Adam Alexander
agreed, it is also useful if you have highly variable bandwidth needs (so you can avoid a monthly fee when you're not getting traffic)
Jiaaro
Thanks that is a very good point Jim, I added this to my answer
Adam Alexander
+1  A: 

I'd say that there's no reason if your base hosting plan provides enough space/bandwidth. Where I think it's useful is when your file transfers become enough that you have to look at buying an add-on of storage/bandwidth from the provider -- in that case, S3 may be a viable alternative. But if I'm paying $X/month and not using all of the storage, there's no upside to it.

On the other hand, if your capacity planning calls for you to someday exceed the provider's limits, S3 may be a good solution from the start so you don't have files being served from multiple places.

Ragoczy
+1  A: 

I would second the mention of "redundancy" -- you can count on any content that's in S3 to be distributed to multiple data centers, and effectively been very much always accessible for anyone with functioning network connection.

Cost may be another factor: data transfer rates for S3 are quite competitive.

And speed is the last one: you can access data VERY fast from S3. But that's more of an issue for data other than browser-viewable images.

StaxMan
+4  A: 

It's simply a matter of doing the numbers: given a certain amount of traffic for a set of files, you can calculate exactly how much hosting those file on S3 would cost you, and you should be able to do the same for your current provider. If the number is lower for S3, there you have your reason.

An added benefit is that S3 scales pretty much linearly with traffic and you pay only for what you actually use, whereas most providers charge you a flat fee no matter how little traffic you actially have, and some will gouge you badly if you ever exceed the maximum traffic included in the flat fee.

Better speed and availability could be an additional benefit.

Basically, if you have a site that could potentially incur wildly disparate traffic, then using S3 for its images and other static files means that if you're hit by the Slashdot effect, the site has a much better chance of staying reachable, and you have a much better chance of avoiding nasty surprises concerning excess traffic fees.

Michael Borgwardt
+1  A: 

For small sites, S3 or Mosso may not be that reasonable for image hosting, but if you have any video files (.wmv, .flv, etc...) or large downloads (app distributions, etc..), I'd still put them on S3 or Mosso to save potential bandwidth spikes if for some odd reason, your content becomes wildly popular.

Chris
+1  A: 

You write:

My server has more than enough disk space, or am I completely missing the point of S3?

You are not missing the point if what you have on you server is write-once read-less-than-once stuff, such as disaster-recovery backups (which you hope will be read-never), because transfer times will not matter. The point of S3 is delivery speed.

First, S3 distributes your content geographically. End users benefit from shorter paths.

Second, S3 can act as a BitTorrent seed, which not only conserves your bandwidth, it means your most popular content will be distributed faster because it can take advantage of the ad-hoc swarm. There are reports on the AWS Discussion Forums that S3 support of the BitTorrent protocol is "very, very spotty." I have not tested it myself.

Thomas L Holaday
When you create an S3 bucket (read: 'folder'), you choose whether you want it stored in the US (cheaper) or Europe (marginally more expensive).I believe for true closest geographic distribution, you must also sign up for a CloudFront account. This then always serves your content to users from the location nearest them.@Ronn Lixx: if you go ahead with putting your files on S3, this isn't something you'll have to worry about, it'll be more than fast enough, I'm sure. I know mine are! CloudFront would only come into play for significant amounts of truly global traffic, like real-time vids.
Jaymie
A: 

It's not really directly related to your actual hosting of web sites, but it's certainly an important part of it, especially if the sites don't belong to you alone -- S3 is a great backup solution. There are tools such as duplicity that can automatically and efficiently back things up onto S3 for you, and it's extremely cheap for this purpose. I back up a fairly large amount of data for less than $1/month.

Chad Birch
+14  A: 

If you run an entire website off of a single machine, and that machine is more than enough to handle your site, then kudos, images are not a bottleneck that needs solving right now. Forget about S3 for now.

However, as your server gets busier, you will want your server to be spending all of its time doing server things. Transferring static content like flat HTML files and images is an easy, dumb job, and wasting precious active connections, bandwidth, and CPU cycles on them is no good. By switching to S3, your server can concentrate on doing what's important, which is whatever your program actually DOES.

S3 also has benefits of being distributed around and attached to what's probably a fatter pipe than your server, which means the images will show up slightly more quickly on your client's machines, so that's an added bonus.

S3 is also backed up, which means that it makes for a pretty nice place to store pretty much any private data under the sun, in addition to stuff that you want to serve to others (although don't confuse the permissions settings between those two things -- in fact, you may want to use separate accounts entirely).

S3 is also nigh-infinite, which means that if you want to let users upload files to your site (profile images, attachments, etc), S3 is a great choice so that you don't have to constantly worry if your server is going to run out of disk space (obligatory $$$ warning here).

But like I said at the top, if you're a one-server setup with a handful of users, none of this really matters. It's a tool like any other, and it may not be something you need yet.

CaptainAwesomePants
+1 for your username. I didn't even read your post. :p
Randolpho
Here is a play-by-play of how I felt in the last few minutes:"Hey, I got a +1! Mood++""Hey, somebody likes my username! Mood++""People only like me for my username and not my brains. Mood-- :(""I wonder if this is how attractive women feel. setMood(contemplative)."
CaptainAwesomePants
it's also a good answer
chris
*chortle*It's also worth noting that S3 buckets cannot have nested folders, so each bucket has a flat file structure. Also, bucket names need to be unique across the whole of Amazon Web Services (I think this bit sucks). If you do move your files, be ready for those constraints.
Jaymie
While this is true, you can have buckets with names that look just like a folder hierarchy. For example, "work", "work/specialClients", "work/specialClients/Acme". It's not a real hierarchy, but you could treat it as one with a bit of effort.
CaptainAwesomePants
S3's latency is pretty bad (~500 ms), so in fact you probably won't see images faster..
Brendan Long
A: 

Many of you won't have this problem, but if you (and your web server) are located in Australia (read: the 3rd world of the Internet), you run into the issue that S3 does not have geographically close locations, which means there will be a higher latency on your images and other static content. Scalable: yes. Fast: no.

Vincent
A: 

Besides the Fat Pipe and Local Delivery arguments for S3 there is also the manner of a single server does not function optimally when its functioning both as a db server and as a file server. If your running any sort of db I would suggest offloading all your static files to s3. The cost is trivial and you will see pretty big performance gains on page load.

Steven
+2  A: 

The advantages of Amazon S3 are reliability, scalability, speed and cost. Here is some info on each.

Reliability: Amazon stores your data in multiple data centers. If there was a disaster and one data center was destroyed your content would continue to be served from the second data center. It’s very unlikely that data you upload to Amazon would ever be lost.

Scalability: If one of your web sites becomes popular and millions of people visit the site, your web server will not be able to handle the load. In comparison when you upload your files to Amazon they are stored in multiple locations. If the load on your content grows your files are automatically replicated to more servers so your files will always be available.

Speed: Amazon has a service called CloudFront that works in conjunction with Amazon S3. When you activate CloudFront on your S3 content your content is moved to edge locations. These are servers that make your content available for high speed transfer.

Cost: With Amazon S3 you only pay for what you use. If you have a few files that get little traffic you will only pay a few cents a month.

SprightlySoft has a blog post which gives even more reasons why Amazon S3 is great. Read it at http://sprightlysoft.com/blog/?p=8

Anton