Different users, same document IDs but different data syncing

16 views
Skip to first unread message

Brendan Duddridge

unread,
Jul 7, 2015, 6:51:55 PM7/7/15
to mobile-c...@googlegroups.com
Hi,

So here's a situation that can occur with my app.

User A gives User B a copy of their data which User B imports into their devices.

User A and User B both have some of the same data on their devices. The same meaning the same document IDs with the same data.

User B wants to sync their data with their own devices, but not with User A's devices.

Can the same document IDs exist on the server used for syncing but independently for each users? I guess I'm asking if each user has their own self contained database on the server.

And can this also co-exist with User A and User B actually wanting to share some of their data, but not all of it?

One reason I'm asking about this is because I pre-populate the database when I distribute my app and all users will definitely have documents with the same document IDs as all other users. So once I setup a cloud sync service, I don't want there to be any issues with syncing. But I also will want the ability for users to sync specific bits of data within their own workgroups.


Thanks,

Brendan

Jens Alfke

unread,
Jul 7, 2015, 9:23:23 PM7/7/15
to mobile-c...@googlegroups.com

On Jul 7, 2015, at 3:51 PM, Brendan Duddridge <bren...@gmail.com> wrote:

Can the same document IDs exist on the server used for syncing but independently for each users? I guess I'm asking if each user has their own self contained database on the server.

No. The server database is a single namespace just like the client ones. If two clients have a document with the same ID, it is exactly the same document, and if one of them changes it, the other gets the changes. That’s very much by design — it enables communication/collaboration between clients and reduces storage overhead.

If user A gives user B data, but it’s supposed to become independent documents owned by user B, and both of them are syncing with the same server database, then the documents have to be re-created by B with different IDs.

—Jens
Reply all
Reply to author
Forward
0 new messages