Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to use Amazon Cloudfront as a CDN provider but unsure of what other services are meant to be.

Do I have to use S3 and EC2 as Virtual Server to host my files and change hosting provider in order to use Cloudfront?

I understand EC2 is a hosting solution but what exactly is S3 then?

Also is there any complexities involved in integrating Cloudfront and S3 and potentially EC3?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

You store your files in s3 and then in cloudfront you enable that s3 bucket where all your files are. You still access all your files via s3 and they get distributed automatically around to amazon's cloudfront locations. When you delete someone from s3 it isn't deleted right away on cloudfront and may take a few minutes.

ec2 is simply a virtual private server that you can spin up on demand.

share|improve this answer
add comment

Do I have to use S3 and EC2 as Virtual Server to host my files and change hosting provider in order to use Cloudfront?

No you don't have to use S3 and/or EC2.

CloudFront does require an ORIGIN. This may be an EC2, an S3 Bucket, or another server that has nothing to do with AWS.

I understand EC2 is a hosting solution but what exactly is S3 then?

EC2 gives you access to compute capacity. It's a Virtual Server.

You can think of S3 as an FTP service. S3 allows you to store files, and retrieve files easily, and without the need for a server.

It can be cheaper then running a virtual Server just to serve files, it's scalable (with no configuration needed). It's also reliable as your files are stored in multiple locations for you.

In addition to being able to store and retrive files, Amazon does let you host static files over HTTP. For example: If you had a simple HTML site with some JS/CSS and images...you could upload all of them to S3 and ask Amazon to host those files for you (no web server required!).

You pay for storage of files, and for bandwidth ... but the price is often much cheaper then setting up a web server to do the same job.

Also is there any complexities involved in integrating Cloudfront and S3 and potentially EC3?

There are a couple of gotcha's with CloudFront but it's not too difficult to setup.

When you setup a new CloudFront distribution you will be asked for an origin. You can either choose an S3 Bucket or a server location (e.g www.domain.com where you files are hosted, maybe this is powered by some EC2s, maybe it's shared hosting at GoDaddy, it doesn't matter!).

Some things to be careful of:

  • You will need to get permissions right, particularly on the S3 bucket. CloudFront needs to be able to access the files.
  • CloudFront is a CDN so it will cache files. If you change a file, CloudFront may not immediately know to update it for you. You may need to manually purge the file in question, or you may need to enable the use of cache busting through paramaters in your URL so that "file.css?v=1" is different from "file.css?v=2".
share|improve this answer
add comment

Your Answer

 
discard

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.