Amazon EC2: Instances, IPs and a wordpress blog (LAMP)

Justin asked:

How do instances spawned from AMIs work when you have a MySQL database? I think I understand that if you have more than one instance and assign the same Elastic IP to both of them, the incoming traffic gets distributed among both. But what happens when the MySQL database gets updated on one of the instances?

I just need to wrap my mind around what happens when I create an AMI and then launch a new instance to help with traffic.

Thanks for your suggestions.

My answer:


You won’t generally run a separate MySQL database on each instance, but a single MySQL database (or perhaps cluster, later) to which all of your instances connect.

So at minimum you have:

Elastic Load Balancer -> Web Server Instances (on EBS or S3) -> Database Instance (on EBS)

If you need to scale the database, you can implement a MySQL Cluster in EBS instances, or just use Amazon RDS.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.