Jens is correct that channels are fairly lightweight, but there are a few 
additional details you may want to take into consideration while evaluating 
your design:

1. Adding/removing users to/from channels is a more computationally 
expensive operation than adding/removing documents to/from a channel.  When 
a user is added to a channel, a Couchbase view call is required to 
recalculate that user's channel access.  When a document is added to a 
channel, it's just an in-memory operation to add that to the cache for that 
channel.  Frequency subscription/unsubscription from a channel is going to 
be a relatively expensive operation.
2. Sync Gateway maintains an in-memory cache of recent changes to a 
channel.  That cache retains at least 50 entries (entries beyond 50 will be 
expire out of the cache).  If most of your channels are shallow (<50 docs), 
it means that Sync Gateway will be attempting to cache a large fraction of 
your total docs in memory.  This will probably need to be considered when 
sizing your SG node(s).
3. Although channels are lightweight, I'd still expect you to see some 
increase in CPU requirements as you increase the number of channels per 
user, particularly as you get into thousands of channels per user.  Each 
replication is making a _changes request that's going to need to check each 
of those channels for changes.  

I don't think any of these are barriers to your design as described, but I 
wanted to share the details as additional context.

Thanks,
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/590bc556-28f1-440a-ac27-082a2b0311cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to