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

I recently set up a micro instance on Amazon EC2, and I was wondering what the process was for sharing a database across instances. Would the easiest solution be to have one instance be dedicated to running the database, and then have all other instances communicate directly to it?

Also, I've read on several sites that EC2 instances should not be considered to be that "reliable". Keeping that in mind, would I then have to have multiple failover instances for my db?

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This is one of those "it depends" questions; you can certainly have multiple EC2 instances accessing a single database, with access controoled via AWS security groups. You could colocate the DBserver with one of the clients that accesses it if the DB server's resource requirements are modest enough.

If the uptime requirments for the database are stringent enough, you should look into having a separate instance for failover. It all depends on how much downtime you can afford. Definitely use EBS volumes to store the database files, since those will persist even if the EC2 instance running the DB server goes down.

A general principle for working with EC2, or any other infrastructure on demand service, is that you should always design your instances with the assumption that they will go down unexpectedly at some point. Again, how far you want to go with that depends on your uptime requirements.

share|improve this answer
1  
Thanks Gareth for your detailed answer. I understand that is is one of those "it depends" questions, but I think you covered the basics. I was also looking into the RDS service that amazon provides, but I feel like I could achieve the same just running MySQL on an EC2 instance. –  pushmatrix Sep 26 '10 at 4:28

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.