Mobile Couchbase Lite

Hi,
I come from a enterprise world where I led a mobile native complete offline application. The mobile app had SQLite database and we had a mobile middleware in between.
So our stack was client with offline database, mobile middleware, backend enterprise app server with RDBMS data base.

Now I am looking to develop an enterprise application where I will develop both the backend and client. I am looking to develop my backend in NoSQL database with node.js. Here I will use couchbase server

On the client side I want the same NoSQL Database as I have offline non connected scenario. Here I will use couchbase Lite.

On the mobile middleware to offer sync, user authentication, etc I wanted to use Sync Gateway. I went through your "Couchbase Mobile 101" training video. As there are no other videos are not available I have several questions:
1. My application is a complex enterprise which will have lot of offline data - are there any limits to the offline db size?
2. You are saying the use of user->role->channel and assign channel to documents. As you can imagine that in enterprise world there will be millions of documents that are created say example is HR documents, Sales videos, Sales visits the rule will not be by channel but distribution rules can be complex by zip code/accounts that user is allowed to see sales data for , etc. So does your Sync Gateway allows to write complex rules and store as procedures that can read during distribution.
3. How does the application will sync data first time? Does it download all the documents related to the user channel first time on the device? I understand that when the network is available you do the automatic sync from device to server - but in that case do you clean up the local database completely?
4. Is couchbase lite still in beta version? When is stable release planned to be out?

Kind Regards,
Amit.

1 Answer

« Back to question.

Hi there Amit, this Jessica Liu, the PM for the Couchbase Mobile products. Thank you for your questions. I've replied in-line as follows:
1. My application is a complex enterprise which will have lot of offline data - are there any limits to the offline db size?
There are no limits on the size of the local offline database; however, if you are looking to sync back to a remote Couchbase Server database, documents and attachments are limited by restrictions on the Server size (20MB).

2. You are saying the use of user->role->channel and assign channel to documents. As you can imagine that in enterprise world there will be millions of documents that are created say example is HR documents, Sales videos, Sales visits the rule will not be by channel but distribution rules can be complex by zip code/accounts that user is allowed to see sales data for , etc. So does your Sync Gateway allows to write complex rules and store as procedures that can read during distribution.
Great point; there's quite a bit of flexibility today with configuring sync, but we in your case rule development may not be as simple as evaluating document attributes, but require deeper level and more complex rules to create channels. If further vetting or business intelligence is needed to ensure the allowance of a channel, or even access to a channel, at sync-time (in your particular use case, this may very well be), we recommend plugging in your evaluations to the Sync Gateway using a client interface that can listen for changes from the Sync Gateway, such as Ektorp. A very brief glimpse into this on some older documentation is available here (https://github.com/couchbaselabs/CouchChat-iOS/wiki/Chat-App-Data-Model#...).

3. How does the application will sync data first time? Does it download all the documents related to the user channel first time on the device? I understand that when the network is available you do the automatic sync from device to server - but in that case do you clean up the local database completely?
If there is already data hosted on the Couchbase Server that needs to be synced to device, you will need to configure your Sync Gateway to recognize that there is data in an existing bucket that it needs to be aware of and sync down; this configuration parameter is called "shadow", and was introducing during our Beta 2. More information for this configuration can be found here: https://github.com/couchbase/sync_gateway/wiki/Bucket-Shadowing

If there is also existing local data, it will not be overwritten by incoming new documents from the Server, but conflicts or updates in the document may emerge, just as in any other use case where changes have been made at the remote backend.

4. Is couchbase lite still in beta version? When is stable release planned to be out?
Our 1.0 is planned for mid-May. We've already code froze our Couchbase Lite iOS and Sync Gateway sources. We will soon be doing the same with Android.

Would love to hear more about your use case. Feel free to reach out to me at jessica [at] couchbase [dot] com.