I am using pouchDB in my hybrid (Ionic) app to send and retrieve data from my Cloudant databases.
I have used continuous replication
until now, but there are too many transactions and the server's bill is going up !
Can you help me rewrite my code with "best practices" to avoid this ?
Is it the best pratice to declare the remote url like this, or should I have a local copy of the database ?
As you can see, I am new to pouchDB/couchDB, and I don't understand how to manage replication correctly.
Thanks for your help!
.factory('usersDatabase', [
'pouchDB',
function (pouchDB) {
'use strict';
var usersDatabase = pouchDB('boaine_users'),
remote = 'https://ididi:[email protected]/boaine_users',
opts = {
live: true,
retry: true
};
usersDatabase.replicate.to(remote, opts);
usersDatabase.replicate.from(remote, opts);
return usersDatabase;
}
])