Replicate to remote CouchDB
See original GitHub issueHi, I’ve been struggling since some days to replicate data to a remote couchDB after I’ve encrypted my local Pouch with crypto-pouch.
First I thought it was not working because I was using a filter, as mentioned in issue 37. I removed the filter and still couldn’t make it work.
After testing, I could finally achieve replication after applying the crypto
function to my remote database as well, using the same password.
If that’s the way it works, could you please make it more clear in your documentation?
Then, I noticed that this way, the data in my remote Couch were been inserted encrypted after the replication.
Is there a way to keep encrypted data on the client, but sent it unencrypted to the remote DB?
Many thanks in advance.
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
2.1. Introduction to Replication - CouchDB Docs
During replication, CouchDB will compare the source and the destination database to determine which documents differ between the source and the destination ...
Read more >Replication - PouchDB
You have an in-memory PouchDB that replicates with a local PouchDB, acting as a cache. You have many remote CouchDB databases that the...
Read more >16. Replication - CouchDB: The Definitive Guide [Book]
A remote database is identified by the same URL you use to talk to it. CouchDB replication works over HTTP using the same...
Read more >Replicating CouchDB data from remote server to local computer
I've recently started playing with CouchDB and just into some small issues. I am trying to replicate data from a aremote server to...
Read more >Replicating from a Query with CouchDB | by Glynn Bird
Apache CouchDB's replication protocol allows documents to be copied from a source database to a target database with the minimum of fuss.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, we had the same issue when encrypting a local PouchDB that was sync with a remote url :
Original code
What we did to solve this issue was to create 2 DBs, one encrypted DB that replicates data from Couchdb into a local Pouchdb (pull changes). One not encrypted remote DB but with no data stored that will push changes.
Adapted code
All get/query requests are done with the localdb and all put/post requests are done with remoteDB.
Also we had to modify crypto pouch index.js file, to add ‘_revisions’ to ignore variable (line 18 var ignore = [‘_id’, ‘_rev’, ‘_deleted’,‘_revisions’]) otherwise localDB will not handle pull changes.
I have a solution for this; have two pouchdb instances, one with crypto pouch loaded as a plugin, one without. Do all your document manipulation in your crypto instance, but setup replication in your blank instance. It’s a little hacky, but was a 2-3 line change for me that works out the box. Data is sent to the server encrypted, and you could then set up the couch server to be able to decrypt given the same password.
I am using this for a zero knowledge application where the server doesn’t have access to any user data, its just a dumb store.