Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 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?


share|improve this question
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
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


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.