Databases Reference
In-Depth Information
core building block for scale), but does not offer guaranteed consistency of replicas at
write time. BASE stores provide a less strict assurance: that data will be consistent in
the future, perhaps at read time (e.g., Riak), or will always be consistent, but only for
certain processed past snapshots (e.g., Datomic).
Given such loose support for consistency, we as developers need to be more knowledg‐
able and rigorous when considering data consistency. We must be familiar with the
BASE behavior of our chosen stores and work within those constraints. At the applica‐
tion level we must choose on a case-by-case basis whether we will accept potentially
inconsistent data, or whether we will instruct the database to provide consistent data at
read time, incurring the latency penalty that that implies. (In order to guarantee con‐
sistent reads, the database will need to compare all replicas of a data element, and in an
inconsistent outcome even perform remedial repair work on that data.) From a devel‐
opment perspective this is a far cry from the simplicity of relying on transactions to
manage consistent state on our behalf, and though that's not necessarily a bad thing, it
does require effort.
The NOSQL Quadrants
Having discussed the BASE model that underpins consistency in NOSQL stores, we're
ready to start looking at the numerous user-level data models. To disambiguate these
models, we've devised a simple taxonomy, as shown in Figure A-1 . This taxonomy di‐
vides the contemporary NOSQL space into four quadrants. Stores in each quadrant
address a different kind of functional use case—though nonfunctional requirements
can also strongly influence our choice of database.
In the following sections we'll deal with each of these quadrants, highlighting the char‐
acteristics of the data model, operational aspects, and drivers for adoption.
Document Stores
Document databases offer the most immediately familiar paradigm for developers who
are used to working with hierarchically structured documents. Document databases
store and retrieve documents, just like an electronic filing cabinet. Documents tend to
comprise maps and lists, allowing for natural hierarchies—much as we're used to with
formats like JSON and XML.
Search WWH ::




Custom Search