pouchdb / pouchdb-server

CouchDB-compatible server built on PouchDB and Node
Apache License 2.0
948 stars 154 forks source link

Unable to store data while running pouch server in backend of Android app #350

Open mavericksthinker opened 6 years ago

mavericksthinker commented 6 years ago

Hello , currently I am working on a cordova project where I am creating a cordova android app with a pouch server running in its background. But the problem that I am facing is its unable to store the data in local storage.

                     `var express = require('express')
                      var app = express()
                      var PouchDB = require('pouchdb')
                      app.use('/', require('express-pouchdb')(PouchDB))
                      app.listen(3001)
                      var db = new PouchDB('mydb')
                      db.changes({live: true}).on('change', console.log)
                      this.db = db
                      db.sync('http://localhost:3002/mydb', {live: true, retry: true})`

So I tried to implement this

                     var argv = require('minimist')(process.argv.slice(2))
                     var argv = require('minimist')(process.argv.slice(2));
                      var logLocation=argv.pouchlog;
                      var controlFileHandler=argv.controlfh;

                      var express = require('express')
                      var app = express()
                      var PouchDB = require('pouchdb')
                      let InMemPouchDB = PouchDB.defaults({db: require("memdown"), migrate: false})
                     app.use('', require('express-pouchdb')(InMemPouchDB, 
                     {mode:'minimumForPouchDB',logPath:logLocation, inMemoryConfig:true}))
                     app.listen(3000)
                     var db = new InMemPouchDB('todos');
                     db.changes({live: true}).on('change', console.log)
                     this.db = db;

The problem with this is that the dataset count in a stress test is just 2600 which is very low . Can anyone help to suggest a way to store the data in the server on the android device storage so that the amount of data count can increase?

BillMeyerRSA commented 4 years ago

Were you able to get this running? Am looking at building an app with Cordova or AndroidJS that runs pouchdb-server for peer to peer syncing.