> On Mar 6, 2015, at 10:47 AM, Sandra <[email protected]> wrote:
>    Is this architecture ok for this scenario or shall we find a way to have 
> only one mobile device acting as a server so that all communicate only to 
> this one?
Yes, that’s ok. The replication protocol/algorithm was explicitly designed to 
support multi-master scenarios with arbitrary topologies between peers.

In a P2P system you do need to be careful about authentication, though. You 
can’t just trust any peer that you discover by Bonjour, or you could end up 
both exposing private data and allowing fake data into the database.
>     In case the above approach is acceptable, is there any limit on the 
> amount of devices that can interact p2p?
There’s not a fixed limit, but the overhead will go up as the number of peers 
increases. The replicator won’t send revision bodies or attachments 
redundantly, but it does pre-flighting to check whether the peer already has a 
revision, and in a dense mesh network there can be a lot of that. We haven’t 
tested a scenario like that, but my hunch is that it would take dozens of peers 
before it became a problem. (The solution to it would be to use mesh-networking 
techniques like spanning trees to lower the number of redundant connections.)
>     When the sync_gateway is reachable again, is there anything we must take 
> into consideration to avoid conflicts or data inconsistency?
Don’t try to push documents that aren’t yours to the gateway :) Or at least, 
not documents you don’t have permission to update. Otherwise the gateway will 
reject them. (Which shouldn’t cause serious problems, it’s just a waste of 
bandwidth.)
> How does couch base lite detect that it no longer has connection to 
> sync_gateway? is it only when we try to write in the database or also when 
> reading? or is there any heart beat?
That’s the replicator’s job. If you have a continuous replication running, it 
will be watching the network status and trying to keep a connection open. You 
can observe the CBLReplication to check when it goes offline/online.

—Jens

-- 
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/3CC673DA-71A2-46AC-88D6-A3EB9E802A3C%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to