Hi,
Another means of doing this is having some parsing in the driver, parse
out the column that the shard is on and column values. Not sure about
this one, but this is pretty much how one of the commercial sharding
solutions does it.
The other way is to do it like libgearmand or libdrizzle, using a server
list and some sort of hashing and distribution.
There does arise the issue of how to combine result sets across shards.
This is a bit of work, as you also have to think about how to deal with
order by and limit - combining result sets, ordering the records and
skimming off the top.
Hmmm... or is it better to do this at the application level?
I'm responding to the original post and I know there have been a bunch
of replies, but I thought I would get my thoughts on replying to this
original question down in an email.
regards,
Patrick
On 2/21/11 11:27 AM, Andrew Hutchings wrote:
Hi guys,
One thing we are planning to work of for Fremont (the branch for
whatever we call the release after Drizzle7) is native sharding in
libdrizzle.
We have a couple of proposals on how to do this and want to get some
feedback:
Method 1:
Implement a function like:
drizzle_con_st* drizzle_con_get_shard(const char* key, size_t length);
This will return the connection for the shard based on a key. Later
on we will support things like server grouping.
Then in layers such as the PHP drizzle module we could add
functionality to do something like:
$drizzle->shardQuery($key, $query);
Method 2:
A callback method so that a custom sharding handler can be added (a
default one would be included)
The first would mostly consist of slightly modifying hashing code
which is already in libmemcached. The second I haven't given much
though cycles too yet.
Please let us know what you think.
Kind Regards
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp