Oracle 5.0 Reference Manual page 1365

Table of Contents

Advertisement

memcached
For information on how to avoid problems, see
Types".
15.6.2.2. Using Namespaces
The
memcached
way of compartmentalizing data automatically into different sections. For example, if you are storing
information by the unique ID returned from a MySQL database, then storing the data from two different
tables could run into issues because the same ID might be valid in both tables.
Some interfaces provide an automated mechanism for creating namespaces when storing information
into the cache. In practice, these namespaces are merely a prefix before a given ID that is applied
every time a value is stored or retrieve from the cache.
You can implement the same basic principle by using keys that describe the object and the unique
identifier within the key that you supply when the object is stored. For example, when storing user data,
prefix the ID of the user with
15.6.2.3. Data Expiry
There are two types of data expiry within a
when you store a new key/value pair into the
a suitable slab to store the value, then an existing least recently used (LRU) object is removed (evicted)
from the cache to make room for the new item.
The LRU algorithm ensures that the object that is removed is one that is either no longer in active
use or that was used so long ago that its data is potentially out of date or of little value. However, in
a system where the memory allocated to
objects required in the cache, a lot of expired items could be removed from the cache even though they
are in active use. You use the statistics mechanism to get a better idea of the level of evictions (expired
objects). For more information, see
You can change this eviction behavior by setting the
memcached. This option forces an error to be returned when the memory has been exhausted, instead
of automatically evicting older data.
The second type of expiry system is an explicit mechanism that you can set when a key/value pair is
inserted into the cache, or when deleting an item from the cache. Using an expiration time can be a
useful way of ensuring that the data in the cache is up to date and in line with your application needs
and requirements.
A typical scenario for explicitly setting the expiry time might include caching session data for a user
when accessing a Web site.
that has been set is compared with the current time when the object is requested. Only objects that
have not expired are returned.
You can also set the expiry time when explicitly deleting an object from the cache. In this case, the
expiry time is really a timeout and indicates the period when any attempts to set the value for a given
key are rejected.
Using
instances from a pool, the hashing and distribution of key/value pairs may be affected.
cache is a very simple massive key/value storage system, and as such there is no
or user-.
user:
Note
Using namespaces or prefixes only controls the keys stored/retrieved. There is
no security within memcached, and therefore no way to enforce that a particular
client only accesses keys with a particular namespace. Namespaces are only
useful as a method of identifying data and preventing corruption of key/value
pairs.
Section 15.6.4, "Getting
memcached
memcached
Section 15.6.2.4,
instance. The first type is applied at the point
memcached
instance. If there is not enough space within
memcached
is smaller than the number of regularly used
memcached
memcached
command-line option when starting
-M
uses a lazy expiry mechanism where the explicit expiry time
1345
"memcached
Hashing/Distribution
Statistics".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents