views:

534

answers:

3

Hello,

I want to publish a web site on Amazon's servers, that:

  1. Runs CakePHP
  2. Uses MySQL to store data
  3. Lets users upload audio through flash (currently using a hosted Flash Media Server), and listen to the files later

Do I need Amazon's EC2 for the website, RDS for the MySQL database, and CloudFront for the FMS? I'd really like a walkthrough of which services I should use.

Thanks.

A: 

You need EC2 to launch instance and create your LAMP server. RDS is good if you don't need to manage MySql db yourself, but one limiting factor of RDS is you can't have DB replication.

For persistent storage, you can make use EBS or S3 for data file.

Rodney Quillo
Will EBS/S3 support flash media server/files? I don't quite understand.
Jasie
+5  A: 

First of all you need EC2 service in order to have a virtual machine, where you can install Apache, PHP and your Web Application.

Then you also need a database server and data repository for the media files. The recommended way is exactly what you suggest: RDS for MySQL and CloudFront as the file repository.

Initially none of the above services (RDS, CloudFront and even EBS) were available. Developers have no way to use a MySQL database, because even if it was installed in an EC2 instance, the instance isn't guaranteed to stay up and running and if the instance is lost, the data is also lost. For this reason EBS was introduced. It created a mounted storage with guaranteed persistence that you could access from the EC2 instance. Theoretically you could install MySQL there and use it to store the flash files. If you only want to serve files through the HTTP protocol, there is no problem using EBS.

CloudFront however has some advantages:

  • Users are automatically routed to the nearest edge location for high performance delivery of your content.
  • You can also use it to stream content through the the RTMP protocol.
  • You don't have to worry about the size of the storage. With EBS you create a storage with a specific size. This could be a problem if you later find out that you need more storage. With CloudFront the files are installed in S3 and you do not need to worry about their size.
  • You do not waste web server capacity. If you use EBS, the files will be served by the server in EC2.

You could also use S3, but you wouldn't able to use the RTMP protocol and you would need to manually create links to your files. Also, it wouldn't be possible to use your domain name for the files.

RDS also has some advantages over installing MySQL in EC2, EBS:

  • automated database backups
  • You can monitor your database with Amazon CloudWatch (free service)
kgiannakakis
Cool, thanks, very useful.
Jasie
A: 

As far as setup goes use http://www.turnkeylinux.org/ something I am looking into. Get a LAMP stack running in minutes, and you can still use it like any other virtual machine connecting with SSH and FTP.

cjheath