Design question - sharing some documents with others and keeping others 'personal'

22 views
Skip to first unread message

Charlie Woloszynski

unread,
Feb 20, 2014, 8:18:30 AM2/20/14
to mobile-c...@googlegroups.com
I am looking to use CBL to support an iOS app that will have two types of data; data that is only synced between the user's iOS devices and data that is made available to other users of the app.  

I am trying to design the architecture for this using CouchBase.  The items are all of the same 'type', but some are marked 'personal' and others are marked as shared with others, so I don't want to create two types of CBLDocuments.  

In the app, I am assuming that I will use CBLViews to organize CBLDocuments into the constructs the local app is concerned with, UI groupings, etc (CBLDocuments can live within categories, for example, so I believe that a view for each category will be appropriate).

What mechanism and where in the architecture do I route documents?  Is that done on the CBLGSyncGateway or in the server itself?  What techniques are available to identify a connection to the server as coming from a particular user?   

If I am using an Authentication Mechanism to access there server based on email addresses, can I simply include in each document the email address of all users who should be able to see the document?  

Are there any exemples of doing something like this that anyone can point me towards?  

Thanks in advance,

Charlie


J. Chris Anderson

unread,
Feb 20, 2014, 1:37:55 PM2/20/14
to mobile-c...@googlegroups.com
When you are writing a Sync Function, you can simply create a channel for private documents. Eg call channel("jchris-private) and the docs will be on their own channel. Then you can grant access to that channel only to the users who need it.

There's a conceptual overview here: https://www.youtube.com/watch?v=KrGmQMvOgv8

Chris
Reply all
Reply to author
Forward
0 new messages