Skip to Main Content
Getting Started with GEO, CouchDB, and Node.js
book

Getting Started with GEO, CouchDB, and Node.js

by Mick Thompson
July 2011
Beginner content levelBeginner
66 pages
1h 19m
English
O'Reilly Media, Inc.
Content preview from Getting Started with GEO, CouchDB, and Node.js

Chapter 3. CouchDB

CouchDB started as a document store with the great ability to replicate data between nodes. This makes it ideal for use cases that involve eventual or relaxed consistency. The built-in replication also makes it the ideal platform for synchronization between mobile, desktop and server. CouchDB sports no fixed schema. Instead it stores documents which are formatted in JSON. JSON, being a lightweight and easy-to-understand notation for simple data structures, is great for this task. And without a rigid schema, CouchDB excels at being a fast developer-friendly datastore.

How Does CouchDB Work?

CouchDB is eventually consistent. CAP Theorem states that any database can only have two out of three of the core properties of a data store. These are:

  • Consistency: That all database clients see the same copy of the data.

  • Availability: that all database clients are able to access a version of the data.

  • Partition tolerance: That the database can be split over multiple servers.

Since CouchDB’s focus is on being partition-tolerant and highly available, this means it is eventually consistent.

Replication

CouchDB’s built in replication can be super useful in creating a highly available and partition tolerant system. Locally, CouchDB uses MVCC ( Multi-Version Concurrency Control) to provide consistent access to data. This means that versions of documents are stored, and updates are appended. Read requests can always read from the most recent version of the document with no need for locking ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

HTML5 Geolocation

HTML5 Geolocation

Anthony T. Holdener
Scaling CouchDB

Scaling CouchDB

Bradley Holt
9 Practical Node.js Projects

9 Practical Node.js Projects

James Hibbard, James Kolce, Lukas White, Jeremy Wilken, Simon Holmes, Michael Wanyoike, Paul Orac, Patrick Catanzariti

Publisher Resources

ISBN: 9781449311230Errata Page