/kuːtʃ diː biː/

n. — "JSON document store obsessed with offline replication sync."

CouchDB is Apache's Erlang-built NoSQL document database storing JSON-like documents with built-in bi-directional replication and multi-version concurrency control (MVCC) for offline-first apps. Unlike MongoDB's master-slave replication, CouchDB treats all nodes equal—changes propagate via HTTP with automatic conflict resolution via revision vectors, using MapReduce views for querying and B-tree indexes for fast lookups.

Key characteristics and concepts include:

  • Bi-directional replication syncing changes between any nodes, resolving conflicts via highest-wins revision trees.
  • MVCC append-only storage preventing write locks, each update creates new document revision.
  • RESTful HTTP API with JSON-over-HTTP, Fauxton web GUI for ad-hoc queries and replication setup.
  • MapReduce views precomputing indexes since no native JOINs, eventual consistency across clusters.

In mobile sync workflow, phone CouchDB diverges offline → reconnects → replicates deltas to server → MapReduce view computes user dashboard from merged revisions.

An intuition anchor is to picture CouchDB as git for databases: every node holds full history, merge conflicts auto-resolve by timestamp, HTTP pushes/pulls replace git fetch—perfect for disconnected chaos unlike MongoDB's replica set dictatorship.