Connecting to Sync Gateway + Server + Lite from NodeJs Server

Hello,

I am developing an application that involves distributed nodes, both desktop and mobile that need to share a synced database. I am hoping to use Server, Lite and Sync gateway to achieve this. The backend of the app is currently written i nNodeJS and uses Ottoman v2 to connect to an instance of Server hosted on a remote machine. I am trying to make the shift to using a local version of Lite on desktop with Sync Gateway to connect and allow support for offline activities.

I believe I have some misunderstandings about how to achieve this, and reading the documentation and forums hasn’t helped clear it up.

When I try connect to the gateway in Ottoman v2 I am swapping the IP of the server for the Sync Gateway port, is this incorrect? If so, how would I connect from NodeJS?

As for Lite, is there a way to set up a standalone Java version of this that runs alongside my app and handles requests from Ottoman?

Thanks for any help, I’ve been stuck on this for a few days now.

Your nodeJS or any web backend application should continue to directly interface with Couchbase Server using CBS SDKs. Your CBL enabled clients will talk to Sync Gateway. See a typical deployment arch

Thanks for the prompt reply.

The desired behavior of the system would be every instance of the app is deployed with CBL, so having nodeJS interface directly with Server won’t work as intended.

We do not support CBL for node.JS apps. Perhaps I don’t understand your use case. The sync technology enabled with Sync Gateway facilitates app deployments in disconnected or unreliable network environments - where there is a need for clients to operate in offline mode is desirable.
I’d expect node.JS backend web application to deployed in connected to the backend system over a reliable network. So a data sync technology would be an overkill. Also, do you need local database within the node.JS app? why?

A nodejs server will be deployed with each instance of the app, in an environment where network connectivity will be unreliable and the uptime of the app is essential.

My hope was to use CBL to allow it to function offline and enable local data storage. Are you saying that it isn’t currently possible for nodejs to interface with CBL and Sync Gateway?