Databases Reference
In-Depth Information
Figure A-1. The NOSQL store quadrants
At the simplest level, documents can be stored and retrieved by ID. Providing an ap‐
plication remembers the IDs it's interested in (e.g., usernames), a document store can
act much like a key-value store (of which we'll see more later). But in the general case,
document stores rely on indexes to facilitate access to documents based on their at‐
tributes. For example, in an ecommerce scenario, we might use indexes to represent
distinct product types so that they can be offered up to potential sellers, as shown in
Figure A-2 . In general, indexes are used to retrieve sets of related documents from the
store for an application to use.
Much like indexes in relational databases, indexes in a document store enable us to trade
write performance for greater read performance; that is, writes are more costly, because
they also maintain indexes, but reads require scanning fewer records to find pertinent
data. For write-heavy records, it's worth bearing in mind that indexes might actually
degrade performance overall.
 
Search WWH ::




Custom Search