KeyValue Store KeyValue Store Built to hold millionsbillions
Key-Value Store
Key-Value Store Built to hold millions/billions of records accessible solely by a single key field. The key is a unique identifier used to locate the data rapidly. The value is the data itself, the format varies. Often the value is just a string of bytes and the application needs to interpret this data. In some implementations the value is self-describing (like JSON). The main characteristic of a key-value store is the fact that every value (data item) must be associated with a unique key, and that retrieving that value by supplying the key must be very fast.
Examples of Key-Value Stores Dynamo DB is used to support Amazon's AWS/SDK platforms and can be used in cloud computing operations. Open Source Voldemort Redis key-value cache and store Apache's Cassandra (used by Facebook)
Voldemort A table/collection/store in Voldemort does not have a schema, it holds a collection of self-describing items. Each item consists of a number of (attribute, value) pairs, and attribute values can be single-valued or multivalued. You specify an item in JSON, and Voldemort converts that to its internal representation.
Voldemort Primary Key All tables have a name and a primary key. The primary key is the key and the item is the value for the Voldemort key-value store. The primary key can be one of the following two types: ◦ A single attribute: Voldemort uses this attribute as a hash index. Items are stored according to the hash value. ◦ A pair of attributes: The first attribute is the hash index, and second attribute is used to order records with the same hash index. Often the first attribute is a unique identifier, and the second is a timestamp.
Voldemort Usage put "k 1" "v 1" put "k 2" "v 2" get "k 1" getall "k 1" "k 2" delete "k 1" get "k 1"
What distinguishes Document Stores from Key-Value Stores? 1. Key-Value stores can't store self-describing data 2. Document stores don't have keys 3. Key-Value can do versioning 4. They are basically the same thing, next question.
- Slides: 7