Thanks this is really really useful.

Our channels are all "open" for reads so we're actually manipulating it 
client side via the `channels` property on the pull replicator. We sync 
first a known set of channels that let us determine the full range of 
channels necessary.

Most of our channels are going to be very shallow so it's good to know 
about the caching. A lot of users will share the same subset of channels 
though.

We probably need to evaluate the performance characteristics a bit more in 
detail for our use case in summary though!

Thanks,
Robert

On Thursday, February 11, 2016 at 7:30:58 AM UTC+13, Adam Fraser wrote:
>
> 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/e9fdbc09-6781-4dea-82cd-e73910909b4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to