|
(1) Key-value stores.
Systems like Redis [30, Chapter 8] or Riak [4] store data in pairs of a unique key and a value. Key- value stores do not manage the structure of these values.
There is no concept of schema beyond distinguishing keys and values. Accordingly, the query model is very basic: Only inserts, updates, and deletes by key are supported, yet no query predicates on val- ues. Since key-value stores do not manage the schema of values, schema evolution is the responsibility of the application.
(2) Document stores.
Systems such as MongoDB [10] or Couch- base [7] also store key-value pairs. However, they store “docu- ments” in the value part. The term “document” connotes loosely structured sets of name-value pairs, typically in JSON (JavaScript Object Notation) format or the binary representation BSON, a more type-rich format of JSON.
Name-value pairs represent the proper- ties of data objects. Names are unique, and name-value pairs are sometimes even referred to as key-value pairs. The document for- mat is hierarchical, so values may be scalar, lists, or even nested documents. Documents within the same document store may differ in their structure, since there is no fixed schema.
Queries in document stores are more expressive than in key- value stores. Apart from inserting, updating, and deleting doc- uments based on the document key, we may query documents based on their properties.
The query languages differ from system to system. Some systems, such as MongoDB, have an integrated query language for ad-hoc queries, whereas other systems, such as CouchDB [30, Chapter 6] and Couchbase, do not. There, the user predefines views in form of MapReduce functions [12, 34].
|
|