Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am migrating my Java,Tomcat, Mysql server to AWS EC2.

I have already attached EBS volume for storing Mysql data. In my web application people may upload images. So I should persist them. There are 2 alternatives in my mind. 1- Save uploaded images to EBS volume. 2- Use S3 service.

The followings are my notes, please be skeptic about them, as my expertise is not on servers, but software development.

EBS plus: S3 storage is more expensive. (0.15 $/Gb > 0.1$/Gb)

S3 plus: Serving statics from EBS may influence my web server's performance negatively. Is this true? Does Serving images affect server performance notably? For S3 my server will not be responsible for serving statics.

S3 plus: Serving statics from EBS may result I/O cost, probably it will be minor.

EBS plus: People say EBS is faster.

S3 plus: People say S3 is more safe for persistence.

EBS plus: No need to learn API, it is straight forward to save the images to EBS volume.

Namely I can not decide, will be happy if you guide.


share|improve this question
up vote 6 down vote accepted

In regard to costs, it is not necessarily true that S3 will cost more than EBS. If you have a 15 GB EBS volume, you pay for all that storage whether it contains 1 GB of data or even no data yet. With S3, you only pay for the actual data stored.

Your strategy should be to use EBS for the mounted volume but to always back EBS up to S3. In the past there was a way to use S3 plus cache for the mounted volume (called PersistentFS) but it is defunct now. So mount an EBS volume and then back it up to S3.

Here are some facts to back up that recommendation as well as a general comparision of EBS and S3:

  • EBS can only be used with EC2 instances while S3 can also be used outside EC2
  • EBS appears as a mountable volume while the S3 requires software to read and write data
  • EBS can accommodate a smaller amount of data than S3
  • EBS can only be used by one EC2 instance at a time while S3 can be used by multiple instances
  • S3 typically experiences write delays while EBS does not
  • S3 is redundant (6 copies I think) while EBS is not.

  • In terms of performance S3 has the higher latency and also has higher variation in latency. S3 write latency can also be higher than read latency . EBS on the other hand has lower latency with less variation. It also has writeback caching for very low write latency.

  • EBS (with 20 GB of modified data) has an expected annual failure rate of 0.1% to 0.5%.

  • With EBS, you pay $0.10 per GB per month for the size of the volume, whether you have stored any data on that volume or not.
  • With S3 you pay $0.15 per GB per month for snapshots -- ONLY FOR DATA ACTUALLY STORED.

  • The reliability of EBS depends on maintaining recent snapshots. As described by Amazon at , the reliability of EBS depends the amount of data stored on the volume that has not been backed up to S3 using a snapshot. Therefore, to achieve durability with EBS, it is important to keep the data on the volume backed up to S3 by taking frequent snapshots.

  • You will be paying both $0.10 per GB per month for the size of the EBS volume, plus $0.15 per GB per month for the S3 snapshots. But multiple snapshots are stored incrementally. If you have a device with 100 GBs of data, but only 5 GBs of data has changed since your last snapshot, only the 5 additional GBs of snapshot data will be stored back to Amazon S3.

share|improve this answer
Thanks, greatly detailed answer.. – enes Jan 28 '11 at 7:16
  1. Costs: Keeping images on S3 will cost you more especially if you use CloudFront. Amazon charges for both traffic and GET/PUT requests and cost of GET/PUT requests may be even higher than traffic costs for small files.

  2. What is safer? S3 is really a safer storage than EBS according to Amazon, but i think it's not a big deal as you may easily backup EBS onto S3 periodically.

  3. API: S3 API is pretty simple and it's not a big problem to save a file onto S3.

  4. Security. It's safer to host user-uploaded files apart from the web application - harder to upload mallicious content onto your web application server for hackers.

  5. Speed. I don't think that EBS hosted files served by tomcat can be faster than files hosted on S3 especially when using CloudFrond (CDN).

Another option I'd recommend is to setup a separate lightweight web server (nginx works perfect for such tasks) to serve static content from EBS. This solution will be rather fast, secure (if served from a separate instance) and cost-effective.

share|improve this answer

Serving statics from EBS may influence my web server's performance negatively

Well, what is amount of your static data? If it's under 1Gb it is very likely to stick in cache, and therefore would not influence performance at all.

share|improve this answer
App is new, data is under 1 Gb for now but expect and hope increases because it is free. Sorry, cache of what? Cache of web server? – enes Feb 16 '10 at 0:57
I mean "disk" cache, files loaded from anything are cached in memory. You may have 100Gb of static data, but if you have 0.5Gb of 'hot files' it will be fast. – BarsMonster Feb 16 '10 at 3:46

What is your traffic volume? Is it worth it to you to you use S3 as a Content Delivery Network or will you use regular S3?

How much more complicated will it be for you to use S3 rather than local storage on the drive with EBS? The static data delivery could be a factor depending your application.

share|improve this answer
For now not so much traffic volume. About 10 Gb for month. But the product is new and free, I have not marketed it so I expect traffic gets higher. Indeed this is free e-shop web application, the users will upload their products' images to system. I have a look at S3 API, it is not complicated to use S3, if you say "Yes using S3 will be good for your web server, as it gets rid of serving statics." then I will decide on S3. – enes Feb 16 '10 at 0:55

If you will have some serious traffic & users you may want to go with S3 because it allows using as a CDN. You may have to consider costs if you are expecting a lot of user data. For S3 you have to pay per GET/PUT, so a lot of small files will cost you. With EBS on your EC2 image you will only pay for bandwidth.

I would suggest you run the numbers. Also see what is easier for your applicatino to do.

share|improve this answer
Thanks Amala, also EBS has request based charge: $0.10 per 1 million I/O requests – enes Feb 17 '10 at 7:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.