2

I'm planning to build an application that runs on WEB(AngularJS), Android(Native), IOS(Native). I have experience with MongoDB, but I found CouchBase which sounds really good for me. I read documentation and I found out I need to use sync_gatway to sync my mobile databases with main database server and reverse, until now everything is fine. I also need to use "channels" to share records with multiple users.

The problem comes when I need to implement this for web application. In their documentation on "Working with web applications" they explain how "bucket shadowing" is working, but they also say:

Bucket shadowing is meant to enable sync for existing Couchbase Server apps. If you are creating a new app with both mobile and web clients, we recommend starting with the Sync Gateway REST APIs, and connecting backend services using the Changes Worker Pattern.

After reading Sync Gateway REST API I found out I'm limited to facebook and persona authentication. So I can't use my own authentication mechanism? Also, there is nothing specified in REST API about channels? Is there any example project or more documentation about this? I couldn't find anything :(

If someone has experience with this, please explain how this works.

Thanks

Paddy
  • 1,195
  • 9
  • 16
  • Another alternative would be to deploy your own REST service in between your AngularJS and Couchbase server that will have all needed API including your own authentication mechanism. For example, you can use Java or NodeJS to build such service. – user1697575 Nov 05 '14 at 16:01
  • how about channels? I wanted to have less logic on my server app side. Even like this? Is there any doc? – Robert Verdo Nov 05 '14 at 18:48

2 Answers2

0

There is also Custom (Indirect) Authentication available on Sync Gateway, which you can use for any type of auth you need.

But you have to hide Sync Gateway's Admin API under your backend layer.

As for the channels: it is responsibility of Sync Function to route different documents to necessary channels based on Document data.

Here is a good video that describes how to build production architecture around Couchbase Lite.

atkit
  • 134
  • 7
0

I'm probably late for the party - but as of today I'd recommend taking a look in the PouchDB project for the WEB AngularJS side - they match pretty well and will sync with Couchbase.

Regarding authentication, I just released an article on that topic, find it here. Hope this helps somebody