Global Positioning System Reference
In-Depth Information
CouchDB replicates and propagates data changes across network
nodes. Among the options set by the CAP theorem (Brewer 2000), CouchDB
prioritises high availability and partition tolerance.
CouchDB uses the MapReduce model (Lee et al. 2012), defined
as JavaScript functions, to query (select and aggregate) documents.
MapReduce enables the development of scalable parallel applications to
process vast amounts of data on large clusters of commodity machines.
The model relies on a Distributed File System (DFS) that is accessed by all
nodes. Two functions are used, “map” and “reduce”, which are applied to
each document separately in such a manner that queries can be distributed
over multiple nodes in parallel.
CouchDB takes advantage of the fact that these functions produce key/
value pairs. These pairs are inserted in a B-Tree that is sorted by key. Thus,
searching by either key or key range is extremely effi cient.
Traditional relational database systems use locking, mainly the two-
phase locking protocol (2PL), to ensure data consistency. In contrast,
CouchDB uses Multi-Version Concurrency Control (MVCC) to manage
concurrent access to data (Anderson et al. 2009). In MVCC, locks acquired for
querying (reading) data do not confl ict with locks acquired for writing data.
As a result, reading operations never block writing operations and vice-
versa. Documents in CouchDB are versioned. Every change in a document
creates a new version of the entire document. After the modifi cation, there
are two versions of the same document: the old and the new version. Thus,
every read operation will always see the latest version in the database.
CouchDB achieves eventual consistency between databases by
incremental replication, in which document changes are periodically copied
between servers. During the replication process, when CouchDB detects
that a document has been modifi ed in both databases being synchronized,
the document is marked as being in confl ict. CouchDB chooses a document
to be considered the latest version, while the other document is labeled as
the earlier version. Thus, both documents can be accessed after confl ict
resolution. The process of confl ict resolution is done automatically in both
databases. After synchronization, each node becomes independent and
self-suffi cient. CouchDB offers libraries for several programming languages
such as Java, .Net, C, PHP, Python, Ruby, among others.
GeoCouch
GeoCouch 8 extends CouchDB to index and search geospatial data. GeoCouch
was developed in Erlang and implements an R-Tree for indexing spatial
8 GeoCouch, https://github.com/couchbase/geocouch/
Search WWH ::




Custom Search