Single database, one channel per user?

This must be a very common scenario, but I don’t see it documented anywhere or mentioned in best practices. It seems to be used in the userprofile sample db, but that is a toy example.

I have a mobile app where each user has a cblite database for their personal content. I am setting up a cb server and gateway to enable cross-device sync for each user. I will use the gateway with oauth.

Am I correct to set this up as a single database where each user has their own channel?

If so, are there any special considerations (eg., scalability issues) to consider with this architecture?

The numbers I’m looking at are:

  • Users: 1000’s to 100,000’s+
  • Documents per user: 100’s to 1000’s

Your approach of setting up seems correct. Check out Channels | Couchbase Docs for more information on channels, limits and constraints

1 Like