I have a single ec2 instance on which I am running multiple separate wordpress sites. I want to store the database for each separate site on it's own mounted ebs volume, so that I can handle the db snapshots and such for each site independently, and so that if one site grows too large it is easy to spin up another instance and mount that site's db data to it. I know how to move all of mysql's data to a separate ebs volume, but what about doing it on a per-database basis?

I would also like to hear if you think this is a bad idea, or alternatives.


You could the innodb_file_per_table (https://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table). Unfortunately you will get a file per table and not per DB (I don't know about an option for this in MySQL).

With this you could link each table-file per symlink to different EBS-Volumes which are mounted to the instance.

You should use an EBS-optimized instance for this to make sure you have a dedicated network link to the EBS devices. I would prefer a PIOPS device and use only one of them - but if you need to separate the snapshots I only know about the way above.

Hope that helps!

  • Thank's dude. I'm going to wait a bit and see if anyone else answers before marking yours as the answer, but I think your method of linking or mounting on a per-table basis and just sorting to different devices by database tables will be it. – gregtczap Apr 2 '14 at 23:18
  • Also, I don't have any need to go beyond a medium instance and only larger instances can be ebs-optimized. What do you think the consequences of not using an ebs-optimized instance would be? I mean are we just talking about network speeds, or do you see more critical problems that could result? – gregtczap Apr 2 '14 at 23:20
  • With EBS-optimized you can think of a dedicated network link only for your EBS devices. So your network traffic to the MySQL won't disturb any I/O operations to the EBS. Without EBS optimized you will use the same network link for your network traffic AND I/O operations. On I/O heavy use cases (like DBs) you should always use EBS optimized. But I think you can give it a try without and scale up if it doesn't work (you simply can stop the instance and change the instance-type afterwards) – Osterjour Apr 25 '14 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.