Oracle 5.0 Reference Manual page 1367

Table of Contents

Advertisement

• Because the determination is handled within the client, the hashing algorithm returns the same value
for a given key; values are not affected or reset by differences in the server environment.
• Selection is very fast. The hashing algorithm on the key value is quick and the resulting selection of
the server is from a simple array of available machines.
• Using client-side hashing simplifies the distribution of data over each
distribution of the values returned by the hashing algorithm means that keys are automatically spread
over the available servers.
Providing that the list of servers configured within the client remains the same, the same stored key
returns the same value, and therefore selects the same server.
However, if you do not use the same hashing mechanism then the same data may be recorded
on different servers by different interfaces, both wasting space on your
potential differences in the information.
Note
One way to use a multi-interface compatible hashing mechanism is to use the
libmemcached
for the different languages (including C, Ruby, Perl and Python) use the same
client library interface, they always generate the same hash code from the ID.
The problem with client-side selection of the server is that the list of the servers (including their
sequential order) must remain consistent on each client using the
must be available. If you try to perform an operation on a key when:
• A new
instance has been added to the list of available instances
memcached
• A
instance has been removed from the list of available instances
memcached
• The order of the
memcached
When the hashing algorithm is used on the given key, but with a different list of servers, the hash
calculation may choose a different server from the list.
If a new
instance is added into the list of servers, as
memcached
then a GET operation using the same key, myid, can result in a cache-miss. This is because the same
value is computed from the key, which selects the same index from the array of servers, but index 2
now points to the new server, not the server
result in a cache miss, even though the key exists within the cache on another
Figure 15.6.
memcached
This means that servers
information stored against the key in eachs server may be different in each instance. A more significant
problem is a much higher number of cache-misses when retrieving data, as the addition of a new
Using
memcached
library and the associated interfaces. Because the interfaces
instances has changed
c.memc
Hash Selection with New
and
c.memc
new.memc
1347
memcached
memcached
memcached
new.memc
where the data was originally stored. This would
instance
memcached
both contain the information for key myid, but the
server. Natural
and leading to
servers, and the servers
is in the example below,
instance.
memcached

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents