Ask HN: Explain AWS
Ok, so I might be completely missing something here, but bear with me. I want to use AWS to build my service. But I am a bit perplexed when it comes to storage. If I have MySQL running where do the database files get stored? Does each EC2 instance come with a certain amount of storage? Would be glad if someone explained this for me :)
33 comments
[ 6.1 ms ] story [ 96.4 ms ] threadYou can run MySQL off of the transient disk ("/mnt") but you should consider running it off of an EBS volume. One reason is because you won't lose the disk if something happens to the instance. Another is that you can use the snapshots feature to create instant backups of your database. Later on you can create new EBS volumes from a snapshot (which is really cool for building a stage environment with production data).
This may sound a bit complicated when you're just starting out. It was for me anyway so after working with AWS for a couple years I started working on a development and deployment tool for EC2. The configuration is entirely via a Ruby DSL.
You define the properties of your environments and roles with the machines DSL (including EBS volumes) and you script your repeatable processes (like deployments) with the routines DSL:
http://github.com/solutious/rudy/blob/0.7/Rudyfile
If Python is more your style, there's boto: http://code.google.com/p/boto/
Two issues that burned me a couple of months ago with EC2 and Elastic Block:
I built my server and got it running just right. I then wanted to back it up, so I bundled it (save your instance to S3) but forgot to register it(list your S3 bundle as a privately available AMI). When I terminated my instance I wasn't able to restart it, because it wasn't available in my list of registered AMI's. I had to rebuild my server from scratch.
The second problem that I had was in rebuilding my database after my instance terminated. Postgres keeps the log files (transactions the database has completed) in the install folder and the data file(what the database has stored) in the storage folder. When I terminated my instance, I lost all the log files that were stored on the EC2 'disk'. I had the data file on elastic block, but the log files were gone. The standard recovery process for postgres needs log files.
It took me a day to figure out how to rebuild the database from just the data files. I now have both the database and the log files on my elastic block image. Hopefully that will help the next time I kill my server. :) I also now have automated backups of everything.
How are you running your automated backups? Have you automated deployment too?
2- the problem with using EBS comes when you have a larger DB, like, oh, 80GB or so. It takes no less than 6-8 hours to produce a snapshot of that -- I just tried it. You can do a simple rsync to another instance in like 2-3 hours. I want to like EBS but it seems ... slow.
I have always wondered about how EBS as disk will affect database as it is essentially a network drive. Any info on that would be great.
The Solaris performance was really poor compared to Linux. I emailed Sun and initially they were really receptive but never explained what was happening. I'm hoping to re-run the tests again soon to see if the latest OpenSolaris (2008-11) has improved.
As far as EBS, another thing to think about is instance types. Since EBS is essentially network attached storage (I believe), network IO greatly affects performance. Small instances don't have particularly great io. Thus, I prefer to run off the transient disk right now over EBS. If we went to larger instance types, which have better network io, that might swing the pendulum.
If you're running MySQL on EC2, it's pretty straightforward. You get an EBS volume for your database and back that volume up to Amazon's S3 service. S3 will then provide multi-site redundancy for your data in the event of AWS availability zone failure.
https://console.aws.amazon.com/
http://developer.amazonwebservices.com/connect/entry.jspa?ex...
If you take the approach described in the above article, you should think about creating a symbolic link to your EBS volume instead of changing MySQL configuration file.
b. You'll have to use EBS if you want persistent disk storage with an AWS instance. Otherwise when you reboot, goodbye to everything on your harddisk.
But, seriously, reconsider your aims of putting up a 24/7 web hosted up on EC2. You're wasting money.
http://articles.slicehost.com/assets/2008/10/3/Slicehost_API...
http://www.slicehost.com/articles/2008/3/26/announcing-the-s...
". Please note that the current iteration allows access to DNS only."
I guess they had another iteration since then, thanks for the info!
I've helped companies build deployment processes with EC2 that allows them to launch a staging environment with a single command that includes a complete copy of production data. They run their tests, then cut a release and shutdown the staging environment with another single command. That's not possible without EC2 and EBS.
You're right that if you compare numbers directly, some aspects of EC2 are more expensive than other vendors. My point is that AWS offers greater value by allowing you to do things you can't do anywhere else.
Allocating static IP addresses on the fly for example.
In fact, with the slicehost api, you can take a snapshot of currently running system, and clone a new slice from that snapshot.
It's also hard to dynamically scale with Slicehost or Linode. You can't have a script bring an instance up for an hour and then shut it down when the load drops off. (Actually, you probably can, but that's not what it's designed for.)
Obviously EC2 is not for everyone, but it is good if you need its features.
That makes it worth the slightly higher costs for me.
I really wish Slicehost or Linode or SoftLayer or someone would do something a little closer to what Amazon's doing, and provide some enterprise-level competition. I have clients who would love to move to Slicehost but probably can't, because of the disk space limit and other similar restrictions.
RightScale's Developer Edition is always free - AND - RightScale Website Edition is FREE for Ycombinator startups while you're actively engaged in the program.