nickva commented on issue #3887:
URL: https://github.com/apache/couchdb/issues/3887#issuecomment-1756164815

   Clustering is a way to connect multiple Apache CouchDB nodes using Erlang's 
native clustering mechanism over TCP connections. At the HTTP API level it 
looks like a single Apache CouchDB instance. With clustering you could get 1) 
better performance, by having nodes process requests in parallel, and 2) 
reliability by having 2 extra document copies on separate nodes. If one or two 
node go down, you can still access you data. However there is more setup 
involved, with some firewall rules. See 
https://docs.couchdb.org/en/stable/cluster/index.html for more info. Clustering 
works best on reliable, low latency, network connections.
   
   Replication is a way to replicate data between any Apache CouchDB compatible 
endpoints. It's a peer-to-peer setup, which is kind of a unique feature amongst 
databases. All the data is replicated via the HTTP API interface. You can run 
replication jobs on any Apache CouchDB instance and it can replicate between 
any two other CouchDB instances.  Replication can be bi-directional (A->B, 
B->A), or you can set up any other topology you like: a star, with a central 
instance, or a circle, etc. Replication is suitable even for high latency or 
unreliable networks, with intermittent connectivity. There are checkpoints and 
retries, which are all configurable.
   
   > Can I write to any node and it replicates to all the others with both 
methods or does that only work with one of them?
   
   In case of replications, you can achieve that with a bi-directional 
replication. If you have CouchDB instances A  and B. You can replicate from A 
to B and then also from B to A. Those two replication jobs, then can also run 
on A, B, or even a third cluster C! You can read more about it in: 
https://docs.couchdb.org/en/stable/replication/index.html But you'd also have 
to be aware of conflicts since the same document could be updated concurrently 
on A and B.  You can read more about it here: 
https://docs.couchdb.org/en/stable/replication/conflicts.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to