[Spock Proxy Devel] Different Shards on the same server
Status: Alpha
Brought to you by:
kaotao
From: steve <iam...@gm...> - 2008-10-23 04:19:07
|
Hi all, Spock Proxy looks very interesting! I have a couple of questions: My 'primary key' for partitioning is in two columns, not one. What to do? (Two is useful, by the way -- sometimes data is useful to a group of shards and you can put that in the first column, sort of a shard group id and then a shard id for that group and when combined, a primary key of sorts for a shard). How do you handle failure of a shard, or is that handled elsewhere? I'm looking at possibly moving to AWS/EC2, and was looking at scalr (http://code.google.com/p/scalr/) as a way to manage the spinning up of and auto-managing instances. It would be awesome if Spock Proxy were directly supported there. Looking over our queries I see that we do on occasion have three tables in a query. Often in the case of any join, one table is one in which to shard upon, and the other (two) are what you call 'universal' tables. By the look of the shard_database_directory, by having port_number in there, it looks like you support having multiple shards running on the same server. I am a fan of having a mysql master and mysql slaves on the same server. Background: In a basic setup of a single master and a single slave on there own servers, you might run into issues of slave lag since the mysql slave only has two threads (one each for io and for sql). If the master was sharded into four mysql instances, as was the slave, then the slave server would have eight threads running (4 IO and 4 SQL). A more ideal setup would be that the master and slave(s) would be mixed. In this case, two master shards on server A and two on server B and the same for the slaves. To avoid a certain amount of IO contention, I put each mysql server instance on a separate dirve/array on a particular machine. Cheaper than raid cards for the same/better performance. -s |