CouchDB architecture: single-leader writes and edge replication
CouchDB replicates documents without merging conflicts. Route writes to one leader, replicate to edge nodes, and resolve conflicts in the application layer.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
CouchDB replicates documents without merging conflicts. Route writes to one leader, replicate to edge nodes, and resolve conflicts in the application layer.
Use CouchDB MapReduce views to pre-aggregate data into B-tree indexes, reducing query-time calculations and avoiding full database scans.
CouchDB's _changes feed provides a persistent, sequence‑ordered log for incremental sync. This blog covers feed semantics, filtered replication, a ready‑to‑run polling script, and the trade‑offs (conflicts, compaction, connection limits) you'll encounter in production.
Create a _replicator document with continuous:true to sync a source CouchDB database to a target node, then verify via _active_tasks.
Learn how CouchDB’s _changes HTTP feed provides a low‑overhead, long‑polling stream of document revisions that lets multiple clients react instantly to updates, plus how to manage connection costs.
CouchDB's _replicator endpoint and MVCC model turn bidirectional sync into a built-in feature. Learn how continuous replication works, where conflicts surface, and what trade-offs to plan for.
Mango JSON selectors are convenient, but unindexed queries scan every document. Declare matching indexes, verify plans with _explain, and use MapReduce views when needed.
CouchDB uses immutable MVCC revisions and the _rev parameter to prevent lost updates. Learn the safe update flow, how to retry after a 409, and why replication conflicts require explicit resolution.
Learn how to use CouchDB's _rev tokens to implement optimistic concurrency control, preventing data loss from concurrent writes and handling HTTP 409 conflicts.