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

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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!

share|improve this answer
    
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. –  Egg Apr 2 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? –  Egg Apr 2 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 at 8:26

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.