On Jan 20, 2014, at 10:25 AM, Akeem P 
<[email protected]<mailto:[email protected]>> wrote:

My initial thought was each user get's their own database and use sync gateway 
to sync them (that seems to have been the prescribed couchdb way though this 
isn't necessarily couchdb) but I'm wondering if this is the best architectural 
way to do it.

With CouchDB it's the only way to do it. It's a reasonable approach as long as 
there is no shared data between users (otherwise you have to set up a large 
number of server-to-server replications to keep everyone's shared data in 
sync.) It does require that you create some server-side infrastructure to 
create and provision new databases as new user accounts are created.

This approach will not work with Couchbase Server because buckets are quite 
heavyweight. Each bucket reserves RAM and is kept 'hot' by the server for 
maximum performance, but that means that you can't realistically have more than 
a dozen or so on a server.

The Sync Gateway is based around the design of putting all the data into a 
single database and using channels and access controls to keep private data 
private.

On another forum someone mentioned using channels but that seems to come with 
it's own limitations (e.g. I'd have to figure out how to make the ids unique to 
a user so that they can co-exist in one bucket).

If the doc IDs are significant to the app, then use the user ID as a prefix 
(e.g. "jens:highscorelist").
If they aren't significant, you can just use UUIDs by letting Couchbase Lite 
make up the doc ID for you.

—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/F1BCE2B7-2780-4D9C-936C-C3C97FDC47F0%40couchbase.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to