libdrizzle sharding functions

Registered by Andrew Hutchings

So, we already have a list of servers in libdrizzled via the use of drizzle_con_add_server(). I propose adding a new function:

drizzle_con_st* drizzle_con_get_shard(const char* key, size_t length);

This would use a consistent hashing algorithm similar to libketama for memcached (http://www.last.fm/user/RJ/journal/2007/04/10/rz_libketama_-_a_consistent_hashing_algo_for_memcache_clients). This link has a better explanation of it:
http://www.mikeperham.com/2009/01/14/consistent-hashing-in-memcache-client/

Alternatively the hashing algorithm from memcached can be used (since it is BSD licensed)

This will return a relevent connection for a key. Using this algorithm will help limit the amount of re-sorting required when adding/removing servers.

Then in layers such as the PHP drizzle library we could add functionality to do something like:

$drizzle->shardQuery($key, $query);

Which would send the query straight to the shard.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
Andrew Hutchings
Definition:
New
Series goal:
Accepted for 7.1
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.