Databases Reference
In-Depth Information
or is replaced, consistent hashing again ensures only a fraction of the total key space is
remapped.
Given such a model, applications wishing to store data in, or retrieve data from, a key-
value store need only know (or compute) the corresponding key. Although there is a
very large number of possible keys in the key set, in practice keys tend to fall out quite
naturally from the application domain. Usernames and email addresses, Cartesian co‐
ordinates for places of interest, Social Security numbers, and zip codes are all natural
keys for various domains. With a sensibly designed system, the chance of losing data in
the store due to a missing key is low.
The key-value data model is similar to the document data model. What differentiates
them is the level of insight each offers into its data.
In theory, key-value stores are oblivious to the information contained in their values.
Pure key-value stores simply concern themselves with efficient storage and retrieval of
opaque data on behalf of applications, unencumbered by its nature and application
usage.
Opacity and Access to Subelements Inside Structured Data
Opacity has a downside. When extracting an element of data from a stored value, clients
often have to retrieve the whole value, and then filter out the unwanted parent or sibling
data elements. Compared to document stores, which perform such operations on the
server, this can be somewhat inefficient.
In practice, such distinctions aren't always so clear-cut. Some of the popular key-value
stores—Riak, for instance—also offer visibility into certain types of structured stored
data like XML and JSON. At a product level, then, there is some overlap between the
document and key-value stores.
Although simple, the key-value model, much as the document model, offers little in the
way of data insight to the application developer. To retrieve sets of useful information
from across individual records, we typically use an external processing infrastructure,
such as MapReduce. This is highly latent compared to executing queries in the data
store.
Key-value stores offer certain operational and scale advantages. Descended as they are
from Amazon's Dynamo database—a platform designed for a nonstop shopping cart
service—they tend to be optimized for high availability and scale. Or, as the Amazon
team puts it, they should work even “if disks are failing, network routes are flapping, or
data centers are being destroyed by tornados.”
 
Search WWH ::




Custom Search