Google News
logo
CouchDB - Interview Questions
How can you do replication?
Replication : Replication synchronizes two copies of the same database; these databases live on the same server or can be live on two different servers. If you change one copy of the database, replication will send the details to another copy.
 
For replication, first you have to send request of HTTP to CouchDB with a source, and a target database and CouchDB will send the changes from source to target.
 
Let's see, how replication looks like :
POST /_replicate with a post body of </li>    
{"source":"$source_database"   
,   
"target":"$target_database"}  
Here $source_database and $target_database can be the names of local database or full URIs of remote databases. Both databases need to be created before they can be replicated from or to.
Advertisement