0

Just trying to spec out a new system. We want to build a mobile app with offline storage using react-native.

We were originally going to use node and create a web api layer that worked with a MongoDB. However after looking into offline storage we found PouchDB. But pouch has to use CouchDB. So we are considering using CouchDb and having a flat db layer with all our business and data logic modelled in the apps.

However there may be some server side things that we need to do (for example pulling other records from somewhere else in the organisation).

So can we deploy a web api using node alongside CouchDb? How would this work? Totally separate or in the same node process?

1
  • You can do whatever you want. Why do you think you'd have a problem? Commented Jun 14, 2017 at 14:34

1 Answer 1

1

So can we deploy a web api using node alongside CouchDb?

Yes, of course.

How would this work?

I'm not sure about what solution suites your needs, but one solution is to develop a web app with this tech-stack: NodeJS/Express, CouchDB/PouchDB and ReactJS/MobX. One important point about CouchDB is that, you shouldn't think about it like any other database . Basically, you don't need any server-side code to talk to CouchDB, it can all be done on the client-side with PouchDB. The live sync of PouchDB is extremely convenient at handling offline/online storage. If you're considering ReactJS, take a look at MobX.

Sign up to request clarification or add additional context in comments.

2 Comments

This what I mean. Do I just install CouchDB and then run it. and then run Node.js on another port for my web api stuff?
@Exitos Yes, your main web app server will run on port 10002 for example. Starting CouchDB is as simple as $ sudo couchdb start and it will automatically run on its default port which probably is port 5984. You can change CouchDB default port by modifying CouchDB configuration files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.