couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "QuickOverview" by NoahSlater
Date Wed, 26 Mar 2008 20:12:45 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by NoahSlater:
http://wiki.apache.org/couchdb/QuickOverview

The comment on the change is:
Copied from original CouchDB wiki

New page:
= Quick Overview =

A quick overview to CouchDB, it's philosophy, architecture, strengths and weaknesses.

== What CouchDB is ==

  * A document database server, accessible via a RESTful [http://json.org/ JSON] API.
  * Ad-hoc and schema-free with a flat address space.
  * Distributed, featuring robust, incremental replication with bi-directional conflict detection
and management.
  * Query-able and index-able, featuring a table oriented reporting engine that uses Javascript
as a query language.

== What CouchDB is not ==

  * A relational database.
  * A replacement for relational databases.
  * An object-oriented database. More specifically, CouchDB is not meant to function as a
seamless persistence layer for an OO programming language.

== What's a Document? ==

A CouchDB document is an object that consists of named fields. Field values are lists that
may contain strings, numbers and dates. An example of a document would be a blog post:

{{{
Subject: "I like Plankton"
Author: "Rusty"
PostedDate: "5/23/2006"
Tags: "plankton" "baseball" "decisions"
Body: "I decided today that I don't like baseball. I like plankton."
}}}

In the above example document, Subject is a field that contains a single string value "I like
plankton". Tags is a field with values "plankton", "baseball" and "decisions".

A Couch database is a flat collection of these documents. Each document is identified by a
unique ID, a DocID. Each document has one (and only one) DocID, and that DocID must be unique.
Two documents with the same ID in different replicas of the same database are considered to
be instances of the same document.

By default, DocIDs are UUIDs (a randomly generated 128 bit number, example: F81D4FAE7DEC11D0A76500A0C91E6BF6),
but ''any string'' can be a document ID.

Examples of valid DocIDs:

{{{
F81D4FAE7DEC11D0A76500A0C91E6BF6
Order_no_57
Global_Config_Settings
http://damienkatz.net/2006/04/error_code_vs_e.html
Whatchootalkinboutwillis
}}}

== Views ==

To address this problem of adding structure back to semi-structured data, CouchDB integrates
a view model using Javascript for description. Views are the method of aggregating and reporting
on the documents in a database, and are built on-demand to aggregate, join and report on database
documents. Views are built dynamically and don’t affect the underlying document, you can
have as many different view representations of the same data as you like.

== Distributed ==

CouchDB is a peer based distributed database system. Any number of CouchDB hosts (servers
and offline-clients) can have independent "replica copies" of the same database, where applications
have full database interactivity (query, add, edit, delete). When back online or on a schedule,
database changes are replicated bi-directionally.

CouchDB has built-in conflict detection and management and the replication process is incremental
and fast, copying only documents and individual fields changed since the previous replication.
Most applications require no special planning to take advantage of distributed updates and
replication.

== Why would I ever want to use CouchDB? ==

=== Document Oriented ===

CouchDB is designed for document-oriented applications. A typical real-world document oriented
activity, if it weren't computerized, would consist mostly of physical paper documents. These
documents would need to get sent around, edited, photocopied, approved, denied, pinned to
the wall, filed away, buried in soft peat for six months, etc. They could be simple yellow
sticky notes or 10,000 page legal documents. Not all document-oriented applications have real
world counterparts.

Some examples of document-oriented applications:

  * CRM
  * Contact Address/Phone Book
  * Forum/Discussion
  * Bug Tracking
  * Document Collaboration/Wiki
  * Customer Call Tracking
  * Expense Reporting
  * To-Dos
  * Time Sheets
  * E-mail
  * Help/Reference Desk

=== Not SQL ===

Unlike SQL databases which are designed to store and report on highly structured, interrelated
data, CouchDB is designed to store and report on large amounts of semi-structured, document
oriented data. CouchDB greatly simplifies the development of document oriented applications,
which make up the bulk of collaborative web applications.

In an SQL database, as needs evolve the schema and storage of the existing data must be updated.
This often causes problems as new needs arise that simply weren't anticipated in the initial
database designs, and makes distributed "upgrades" a problem for every host that needs to
go through a schema update.

With CouchDB, no schema is enforced, so new document types with new meaning can be safely
added alongside the old. The view engine is designed to easily handle new document types and
disparate but similar documents.

=== Distributed ===

CouchDB is built from the start with a consistent vision of a distributed document database
system. Unlike cumbersome attempts to bolt distributed features on top of the same legacy
models and databases, it is the result of careful ground-up design, engineering and integration.
The document, view, security and replication models and the efficient and robust disk layout
are designed to work together for a reliable, easy to use and efficient system.

Mime
View raw message